ZF-10779: Autoloaders lost in Zend_Loader_Autoloader


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.


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.

Resolved as part of ZF-10136