3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $o = new stdclass($x=125); var_dump($x); $dt = new DateTime($b="now"); var_dump($b);
Output for hhvm-3.10.0 - 3.13.2, 7.1.0
int(125) string(3) "now"
Output for 5.2.0 - 5.6.28, 7.0.0 - 7.0.14
Notice: Undefined variable: x in /in/I3Hs9 on line 3 NULL string(3) "now"
Output for 5.0.4 - 5.1.6
Notice: Undefined variable: x in /in/I3Hs9 on line 3 NULL Fatal error: Class 'DateTime' not found in /in/I3Hs9 on line 4
Process exited with code 255.
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: x in /in/I3Hs9 on line 3 NULL Fatal error: Class 'DateTime' not found in /in/I3Hs9 on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Notice: Undefined variable: x in /in/I3Hs9 on line 3 NULL Fatal error: Cannot instantiate non-existent class: datetime in /in/I3Hs9 on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Undefined variable: x in /in/I3Hs9 on line 3 NULL Fatal error: Cannot instantiate non-existent class: datetime in /in/I3Hs9 on line 4