3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function __autoload($class_name) { var_dump($class_name); } $a = new FOO(); $c = 'BAR'; $b = new $c();
Output for 7.0.0 - 7.1.0
string(3) "FOO" Fatal error: Uncaught Error: Class 'FOO' not found in /in/Ke3qS:7 Stack trace: #0 {main} thrown in /in/Ke3qS on line 7
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
string(3) "FOO" Fatal error: Class undefined: FOO in /in/Ke3qS on line 7
Process exited with code 255.
Output for 5.2.3 - 5.6.28
string(3) "FOO" Fatal error: Class 'FOO' not found in /in/Ke3qS on line 7
Process exited with code 255.
Output for 5.0.0 - 5.2.2
string(3) "FOO" <br /> <b>Fatal error</b>: Class 'FOO' not found in <b>/in/Ke3qS</b> on line <b>7</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.4.9
<br /> <b>Fatal error</b>: Cannot instantiate non-existent class: foo in <b>/in/Ke3qS</b> on line <b>7</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1
<br /> <b>Fatal error</b>: Cannot instantiate non-existent class: foo in <b>/in/Ke3qS</b> on line <b>7</b><br />