- spl_autoload_register: documentation ( source)
<?php
class Autoload {
public static function load($class)
{
return false;
}
public static function loadFile($path)
{
include $path;
return self::$loadedClasses[$path];
}
}
// Register the autoloader before any existing autoloaders to ensure
// it gets a chance to hear about every autoload request, and record
// the file and class name for it.
spl_autoload_register(__NAMESPACE__.'\Autoload::load', true, true);
//try {
class Foo extends Bar {};
/*
} catch(Error $e) {
var_dump($e);
}
*/