3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $o1 = new stdclass($_GLOBALS['a']=8); var_dump($GLOBALS['a']); // Notice: Undefined variable: a var_dump($o1); $o2 = new Datetime($b='now'); var_dump($b); // string "now" var_dump($GLOBALS['b']);
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined index: a in /in/oNOOO on line 3 NULL object(stdClass)#1 (0) { } string(3) "now" string(3) "now"
Output for hhvm-3.10.0 - 3.12.0
NULL object(stdClass)#1 (0) { } string(3) "now" string(3) "now"
Output for 5.2.0 - 5.2.17
Notice: Undefined index: a in /in/oNOOO on line 3 NULL object(stdClass)#1 (0) { } string(3) "now" string(3) "now"
Output for 5.0.0 - 5.1.6
Notice: Undefined index: a in /in/oNOOO on line 3 NULL object(stdClass)#1 (0) { } Fatal error: Class 'Datetime' not found in /in/oNOOO on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Notice: Undefined index: a in /in/oNOOO on line 3 NULL object(stdClass)(0) { } Fatal error: Cannot instantiate non-existent class: datetime in /in/oNOOO on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Undefined index: a in /in/oNOOO on line 3 NULL object(stdClass)(0) { } Fatal error: Cannot instantiate non-existent class: datetime in /in/oNOOO on line 6