ZF-10779: Autoloaders lost in Zend_Loader_Autoloader

Issue Type: Bug Created: 2010-12-05T08:48:22.000+0000 Last Updated: 2011-08-28T09:30:48.000+0000 Status: Resolved Fix version(s): Reporter: Wadim Grasza (wadim.grasza) Assignee: Pádraic Brady (padraic) Tags: - Zend_Loader

  • zf-crteam-padraic
  • zf-crteam-priority

Related issues: - ZF-10136



Zend_Loader_Autoloader contains the following code in getClassAutoloaders($class) function:

355: // Add non-namespaced autoloaders 356: $autoloaders = $autoloaders + $this->getNamespaceAutoloaders('');

Let N denote the number of elements of $autoloaders array before execution of line 356. Because of the array union '+' operator, exactly N first elements of the result of getNamespaceAutoloaders() are lost.


Posted by Wadim Grasza (wadim.grasza) on 2010-12-05T10:28:13.000+0000

The effective result of this bug is that you cannot chain an autoloader for an empty namespace.

To reproduce: 1. Register 'My_' namespace with the autoloader. 2. Invoke pushAutoloader for an empty namespace. 3. Try to autoload a class that starts with 'My_'.

Result: The autoloader pushed in 2. is not added to the list of tried autoloaders.

Posted by Pádraic Brady (padraic) on 2011-08-28T09:30:48.000+0000

Resolved as part of ZF-10136

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.