3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $foo = new class {}; var_dump(get_class($foo)); $bar = eval('return new class extends ' . get_class($foo) . ' {}'); var_dump($foo);
based on ej8aB
Output for 7.2.0
string(39) "class@anonymous/in/YlmcW0x7f7e2fc1e019" Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or namespace (T_NAMESPACE) or \\ (T_NS_SEPARATOR) in /in/YlmcW(5) : eval()'d code on line 1
Process exited with code 255.
Output for 7.1.10
string(39) "class@anonymous/in/YlmcW0x7fb3b040d019" Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or namespace (T_NAMESPACE) or \\ (T_NS_SEPARATOR) in /in/YlmcW(5) : eval()'d code on line 1
Process exited with code 255.
Output for 7.1.7
string(39) "class@anonymous/in/YlmcW0x7f289846f019" Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or namespace (T_NAMESPACE) or \\ (T_NS_SEPARATOR) in /in/YlmcW(5) : eval()'d code on line 1
Process exited with code 255.
Output for 7.1.6
string(39) "class@anonymous/in/YlmcW0x7fcdc9726019" Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or namespace (T_NAMESPACE) or \\ (T_NS_SEPARATOR) in /in/YlmcW(5) : eval()'d code on line 1
Process exited with code 255.
Output for 7.1.5
string(39) "class@anonymous/in/YlmcW0x7f02eace1019" Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or namespace (T_NAMESPACE) or \\ (T_NS_SEPARATOR) in /in/YlmcW(5) : eval()'d code on line 1
Process exited with code 255.
Output for 7.1.0
string(39) "class@anonymous/in/YlmcW0x7f267add5019" Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or namespace (T_NAMESPACE) or \\ (T_NS_SEPARATOR) in /in/YlmcW(5) : eval()'d code on line 1
Process exited with code 255.
Output for 7.0.20
string(39) "class@anonymous/in/YlmcW0x7ff6387c8019" Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or namespace (T_NAMESPACE) or \\ (T_NS_SEPARATOR) in /in/YlmcW(5) : eval()'d code on line 1
Process exited with code 255.
Output for 7.0.6
string(39) "class@anonymous/in/YlmcW0x7f6b24c80019" Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or namespace (T_NAMESPACE) or \\ (T_NS_SEPARATOR) in /in/YlmcW(5) : eval()'d code on line 1
Process exited with code 255.
Output for 7.0.5
string(39) "class@anonymous/in/YlmcW0x7f38c370c019" Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or namespace (T_NAMESPACE) or \\ (T_NS_SEPARATOR) in /in/YlmcW(5) : eval()'d code on line 1
Process exited with code 255.
Output for 7.0.4
string(39) "class@anonymous/in/YlmcW0x7fde92612019" Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or namespace (T_NAMESPACE) or \\ (T_NS_SEPARATOR) in /in/YlmcW(5) : eval()'d code on line 1
Process exited with code 255.
Output for 7.0.3
string(39) "class@anonymous/in/YlmcW0x7f477cd1e019" Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or namespace (T_NAMESPACE) or \\ (T_NS_SEPARATOR) in /in/YlmcW(5) : eval()'d code on line 1
Process exited with code 255.
Output for 7.0.2
string(39) "class@anonymous/in/YlmcW0x7f9754b85019" Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or namespace (T_NAMESPACE) or \\ (T_NS_SEPARATOR) in /in/YlmcW(5) : eval()'d code on line 1
Process exited with code 255.
Output for 7.0.1
string(39) "class@anonymous/in/YlmcW0x7f973d1ce019" Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or namespace (T_NAMESPACE) or \\ (T_NS_SEPARATOR) in /in/YlmcW(5) : eval()'d code on line 1
Process exited with code 255.
Output for 7.0.0
string(39) "class@anonymous/in/YlmcW0x7fc0be181019" Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or namespace (T_NAMESPACE) or \\ (T_NS_SEPARATOR) in /in/YlmcW(5) : eval()'d code on line 1
Process exited with code 255.
Output for 5.4.11 - 5.6.28
Parse error: syntax error, unexpected 'class' (T_CLASS) in /in/YlmcW on line 3
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Parse error: syntax error, unexpected T_CLASS in /in/YlmcW on line 3
Process exited with code 255.