3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // Source: https://bugs.php.net/bug.php?id=63305 new Attachment(''); function __autoload($class) { switch ($class) { case "Attachment": eval('class Attachment extends File {}'); break; case "File": eval('class File { use TDatabaseObject { TDatabaseObject::__construct as private databaseObjectConstruct; } public function __construct() {} }'); break; case "TDatabaseObject": eval('trait TDatabaseObject { public function __construct() {}}'); break; } return TRUE; }
Output for 7.2.0
Deprecated: __autoload() is deprecated, use spl_autoload_register() instead in /in/ZphOa on line 6
Output for 5.4.0 - 7.1.10
Output for 5.1.0 - 5.3.29
Parse error: syntax error, unexpected T_USE, expecting T_FUNCTION in /in/ZphOa(14) : eval()'d code on line 1 Fatal error: Class 'File' not found in /in/ZphOa(11) : eval()'d code on line 1
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_USE, expecting T_FUNCTION in /in/ZphOa(14) : eval()'d code on line 1 Fatal error: Class 'File' not found in /in/ZphOa(11) : eval()'d code on line 1
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: attachment in /in/ZphOa on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: attachment in /in/ZphOa on line 4