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 7.1.0
int(8) object(stdClass)#1 (0) { } string(3) "now" Notice: Undefined index: b in /in/khPS3 on line 8 NULL
Output for 5.2.0 - 7.0.14
Notice: Undefined variable: _GLOBALS in /in/khPS3 on line 3 NULL object(stdClass)#1 (0) { } string(3) "now" Notice: Undefined variable: _GLOBALS in /in/khPS3 on line 8 NULL
Output for 5.0.4 - 5.1.6
Notice: Undefined variable: _GLOBALS in /in/khPS3 on line 3 NULL object(stdClass)#1 (0) { } Fatal error: Class 'Datetime' not found in /in/khPS3 on line 6
Process exited with code 255.
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: _GLOBALS in /in/khPS3 on line 3 NULL object(stdClass)#1 (0) { } Fatal error: Class 'Datetime' not found in /in/khPS3 on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Notice: Undefined variable: _GLOBALS in /in/khPS3 on line 3 NULL object(stdClass)(0) { } Fatal error: Cannot instantiate non-existent class: datetime in /in/khPS3 on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Undefined variable: _GLOBALS in /in/khPS3 on line 3 NULL object(stdClass)(0) { } Fatal error: Cannot instantiate non-existent class: datetime in /in/khPS3 on line 6