method_exists

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Checks if the class method exists
<?php method_exists(object|string $object_or_class, string $method): bool
<?php         }



        try {

            if (method_exists($user, 'toFlare')) {

                return $user->toFlare();

            }
<?php                 return $user->toFlare();

            }



            if (method_exists($user, 'toArray')) {

                return $user->toArray();

            }

        } catch (Throwable $e) {