#33903 [Asn->Fbk]: spl_autoload_register class method

From: Date: Wed, 21 Sep 2005 10:11:33 +0000
Subject: #33903 [Asn->Fbk]: spl_autoload_register class method
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-85344@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: Assigned +Status: Feedback Bug Type: Feature/Change Request Operating System: * PHP Version: 5.1.0 Assigned To: helly New Comment: Implemented in HEAD please check. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#85344) next »