Skip to content

[Zend Framework] Calling the self:: reference causes a stack overflow #976

@kornstar11

Description

@kornstar11

Using the Zend Framework 1.12. I am getting the following error:
HipHop Fatal error: Stack overflow in /var/www/library/Zend/Loader/Autoloader.php on line 116

Here is the code on line 116:

    public static function autoload($class)
    {
        $self = self::getInstance();          ---- LINE:116-----
        
        foreach ($self->getClassAutoloaders($class) as $autoloader) {
            if ($autoloader instanceof Zend_Loader_Autoloader_Interface) {
                if ($autoloader->autoload($class)) {
                    return true;
                }
            } elseif (is_array($autoloader)) {
                if (call_user_func($autoloader, $class)) {
                    return true;
                }
            } elseif (is_string($autoloader) || is_callable($autoloader)) {
                if ($autoloader($class)) {
                    return true;
                }
            }
        }

        return false;
    }

And here is the getInstance code:

 public static function getInstance()
    {
        if (null === self::$_instance) {
            self::$_instance = new self();
        }
        return self::$_instance;
    }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions