PHP :: Request #33903 :: spl_autoload_register class method
| Request #33903 | spl_autoload_register class method | ||||
|---|---|---|---|---|---|
| Submitted: | 2005-07-28 14:02 UTC | Modified: | 2005-09-27 10:21 UTC | ||
| From: | marcos dot neves at gmail dot com | Assigned: | helly (profile) | ||
| Status: | Closed | Package: | Feature/Change Request | ||
| PHP Version: | 5.1.0-rc1 | OS: | * | ||
| Private report: | No | CVE-ID: | None | ||
[2005-07-28 14:02 UTC] marcos dot neves at gmail dot com
Description:
------------
What about spl_autoload_register accept class methods too, like usort and other php functions
Reproduce code:
---------------
<?
class MyAutoLoader {
function autoLoad($className) {
// autload code
}
}
spl_autoload_register(array('MyAutoLoader', 'autoLoad'));
// and
$myAutoLoader = new MyAutoLoader();
spl_autoload_register(array($myAutoLoader, 'autoLoad'));
?>
Expected result:
----------------
works!
Actual result:
--------------
Warning: spl_autoload_register() expects parameter 1 to be string, array given in C:\wamp\include_path\tests\spl\spl_autoload_register_class.test.php on line 10
Warning: spl_autoload_register() expects parameter 1 to be string, array given in C:\wamp\include_path\tests\spl\spl_autoload_register_class.test.php on line 15
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2005-07-28 20:41 UTC] helly@php.net
[2005-09-21 12:11 UTC] helly@php.net
[2005-09-27 10:21 UTC] helly@php.net