class_parents

Supported Versions: PHP 5, PHP 7, PHP 8
Return the parent classes of the given class
<?php class_parents(object|string $object_or_class, bool $autoload = true): array|false
<?php             }

        }



        $parents = @class_parents($stripped);



        if ($parents !== false) {

            foreach ($parents as $parent) {
<?php         $results = [];



        foreach (array_reverse(class_parents($class) ?: []) + [$class => $class] as $class) {

            $results += trait_uses_recursive($class);

        }
<?php                 $message = str_replace(self::UNDEFINED_METHOD, 'Call to undefined method ', $message);



                if (class_exists((string) $class) && (is_countable(class_parents($class)) ? count(class_parents($class)) : 0) > 0 && array_values(class_parents($class))[0] === TestCase::class) { // @phpstan-ignore-line

                    $message .= '. Did you forget to use the [uses()] function? Read more at: https://pestphp.com/docs/configuring-tests';

                }
<?php             $parents = [$class];

            $hasDebugInfo = method_exists($class, '__debugInfo');



            foreach (class_parents($class) as $p) {

                $parents[] = $p;

                ++$i;

            }