ID:               43862
 Updated by:       [EMAIL PROTECTED]
 Reported By:      rpanning at hotmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         SPL related
 Operating System: Windows XP SP2
 PHP Version:      5.3CVS-2008-01-16 (snap)
 New Comment:

spl_autoload_register(__NAMESPACE__ .'::load_class');
spl_autoload_register(array(__NAMESPACE__ .'::Test', 'load_class'));
spl_autoload_register(__NAMESPACE__ .'::Test::load_class');

Works fine!


Previous Comments:
------------------------------------------------------------------------

[2008-01-16 05:02:16] rpanning at hotmail dot com

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


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=43862&edit=1

Reply via email to