|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-01-22 17:01 UTC] felipe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 05:00:01 2025 UTC |
Description: ------------ Currently spl_autoload_register() is unable to load any functions or class static functions in namespaces. Reproduce code: --------------- namespace NS; function load_class($name) { // load class file } class Test { public static function load_class($name) { // load class file } } spl_autoload_register(array('NS', 'load_class')); spl_autoload_register(array('NS', 'Test', 'load_class')); var_dump(spl_autoload_functions()); Expected result: ---------------- Should output an array with the registered namespace function and namespace class static function. Actual result: -------------- Fatal error: Uncaught exception 'LogicException' with message 'Passed array does not specify an existing static method' in C:\PHP\file.php:14 Stack trace: #0 C:\PHP\file.php(14): spl_autoload_register(Array) #1 {main} thrown in C:\PHP\file.php on line 14