3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $o1 = new stdclass($a=8); var_dump($a); // Notice: Undefined variable: a var_dump($o1); $o2 = new Datetime($b='now'); var_dump($b); // string "now"
Output for hhvm-3.10.0 - 3.12.0, 7.1.0
int(8) object(stdClass)#1 (0) { } string(3) "now"
Output for 5.2.0 - 5.6.28, 7.0.0 - 7.0.14
Notice: Undefined variable: a in /in/hBYeQ on line 4 NULL object(stdClass)#1 (0) { } string(3) "now"
Output for 5.0.4 - 5.0.5, 5.1.1 - 5.1.6
Notice: Undefined variable: a in /in/hBYeQ on line 4 NULL object(stdClass)#1 (0) { } Fatal error: Class 'Datetime' not found in /in/hBYeQ on line 8
Process exited with code 255.
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/hBYeQ on line 9
Process exited with code 255.
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: a in /in/hBYeQ on line 4 NULL object(stdClass)#1 (0) { } Fatal error: Class 'Datetime' not found in /in/hBYeQ on line 8
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Notice: Undefined variable: a in /in/hBYeQ on line 4 NULL object(stdClass)(0) { } Fatal error: Cannot instantiate non-existent class: datetime in /in/hBYeQ on line 8
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Undefined variable: a in /in/hBYeQ on line 4 NULL object(stdClass)(0) { } Fatal error: Cannot instantiate non-existent class: datetime in /in/hBYeQ on line 8