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     public function run(InputInterface $input, OutputInterface $output): int

    {

        if (!method_exists($input, '__toString')) {

            throw new \LogicException('Expected an Input instance that is stringable, got '.get_class($input));

        }
<?php     public function resetComposer()

    {

        $this->composer = null;

        if (method_exists($this->getIO(), 'resetAuthentications')) {

            $this->getIO()->resetAuthentications();

        }

    }
<?php     private static function getInstalled()

    {

        if (null === self::$canGetVendors) {

            self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');

        }



        $installed = array();
<?php             return !$exclude;

        };



        if (method_exists($filter, 'bindTo')) {

            $filter = $filter->bindTo(null);

        }
<?php                 if (method_exists($zip, 'setExternalAttributesName')) {

                    $perms = fileperms($filepath);
<?php     private static function getInstalled()

    {

        if (null === self::$canGetVendors) {

            self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');

        }



        $installed = array();
<?php     private static function getInstalled()

    {

        if (null === self::$canGetVendors) {

            self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');

        }



        $installed = array();