#33903 [Fbk->Csd]: spl_autoload_register class method
| From: | helly@php.net | Date: | Tue, 27 Sep 2005 08:21:48 +0000 |
| Subject: | #33903 [Fbk->Csd]: spl_autoload_register class method | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-85632@lists.php.net to get a copy of this message | ||
ID: 33903
Updated by: helly@php.net
Reported By: marcos dot neves at gmail dot com
-Status: Feedback
+Status: Closed
Bug Type: Feature/Change Request
Operating System: *
-PHP Version: 5.1.0
+PHP Version: 5.1.0-rc1
Assigned To: helly
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2005-09-21 12:11:32] helly@php.net
Implemented in HEAD please check.
------------------------------------------------------------------------
[2005-07-28 20:41:39] helly@php.net
This has to be delayed until after 5.1 since it requires a complete
reqrite of the internal function handling. Maybe staic functions are
easier.
------------------------------------------------------------------------
[2005-07-28 14:02:26] 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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33903&edit=1