<?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);
}
*/
Fatal error: Class 'Bar' not found in /in/TZ9Aj on line 24
Process exited with code 255.
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Notice: Use of undefined constant __NAMESPACE__ - assumed '__NAMESPACE__' in /in/TZ9Aj on line 20
Fatal error: Class 'Bar' not found in /in/TZ9Aj on line 24
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function spl_autoload_register() in /in/TZ9Aj on line 20
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/TZ9Aj on line 5
Process exited with code 255.
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/TZ9Aj on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/TZ9Aj on line 5
Process exited with code 255.