<?php
namespace Foobar;
class Foo {
static public function test($name) {
print '[['. $name .']]';
}
}
spl_autoload_register(__NAMESPACE__ .'\Foo::test'); // As of PHP 5.3.0
new InexistentClass;
[[Foobar\InexistentClass]]
Fatal error: Uncaught Error: Class "Foobar\InexistentClass" not found in /in/oQ7vM:12
Stack trace:
#0 {main}
thrown in /in/oQ7vM on line 12
Process exited with code 255.
[[Foobar\InexistentClass]]
Fatal error: Uncaught Error: Class 'Foobar\InexistentClass' not found in /in/oQ7vM:12
Stack trace:
#0 {main}
thrown in /in/oQ7vM on line 12
Process exited with code 255.