Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.10.6
-
Component/s: Zend_Loader
-
Labels:None
Description
When calling $autoloader->(push|unshift)Autoloader($callback) where $callback is a lambda, the callback is added to the stack but is never invoked during the actual autoloading. The autoload() method validates every callback and handles only callbacks of the form $functionName or array($objectOrClassname, $method).
It also might be a good idea to move the callback validation from autoload() to (push|unshift)Autoloader() so that the validation occurs only once and we may throw an exception if the callback passed is invalid.
My proposed changes, not sure if these are satisfactory. NOTE: The attached AutoloaderTest.diff is for PHP 5.3+ only!