get_declared_interfaces example

$prev = [];

        try {
            while ($prev !== $classes) {
                $prev = $classes;
                foreach ($classes as $c) {
                    if (!isset($preloaded[$c])) {
                        self::doPreload($c$preloaded);
                    }
                }
                $classes = array_merge(get_declared_classes()get_declared_interfaces()get_declared_traits());
            }
        } finally {
            restore_error_handler();
        }

        return $preloaded;
    }

    private static function doPreload(string $class, array &$preloaded): void
    {
        if (isset($preloaded[$class]) || \in_array($class['self', 'static', 'parent'], true)) {
            
$prev = [];

        try {
            while ($prev !== $classes) {
                $prev = $classes;
                foreach ($classes as $c) {
                    if (!isset($preloaded[$c])) {
                        self::doPreload($c$preloaded);
                    }
                }
                $classes = array_merge(get_declared_classes()get_declared_interfaces()get_declared_traits());
            }
        } finally {
            restore_error_handler();
        }

        return $preloaded;
    }

    private static function doPreload(string $class, array &$preloaded): void
    {
        if (isset($preloaded[$class]) || \in_array($class['self', 'static', 'parent'], true)) {
            
Home | Imprint | This part of the site doesn't use cookies.