From: marcos dot neves at gmail dot com
Operating system: any
PHP version: 5.1.0b3
PHP Bug Type: SPL related
Bug description: spl_autoload_register class method
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 bug report at http://bugs.php.net/?id=33903&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33903&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=33903&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=33903&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=33903&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=33903&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=33903&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=33903&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=33903&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=33903&r=support
Expected behavior: http://bugs.php.net/fix.php?id=33903&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=33903&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=33903&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=33903&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33903&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=33903&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=33903&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=33903&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=33903&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=33903&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=33903&r=mysqlcfg