3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $o1 = new stdclass($a=8); var_dump(stdclass/$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
Notice: Use of undefined constant stdclass - assumed 'stdclass' in /in/SOIAL on line 3 Warning: A non-numeric value encountered in /in/SOIAL on line 3 int(0) object(stdClass)#1 (0) { } string(3) "now" string(3) "now"
Output for 7.0.0 - 7.0.14
Notice: Use of undefined constant stdclass - assumed 'stdclass' in /in/SOIAL on line 3 Notice: Undefined variable: a in /in/SOIAL on line 3 Warning: Division by zero in /in/SOIAL on line 3 float(NAN) object(stdClass)#1 (0) { } string(3) "now" string(3) "now"
Output for 5.2.0 - 5.6.28
Notice: Use of undefined constant stdclass - assumed 'stdclass' in /in/SOIAL on line 3 Notice: Undefined variable: a in /in/SOIAL on line 3 Warning: Division by zero in /in/SOIAL on line 3 bool(false) object(stdClass)#1 (0) { } string(3) "now" string(3) "now"
Output for 5.0.4 - 5.1.6
Notice: Use of undefined constant stdclass - assumed 'stdclass' in /in/SOIAL on line 3 Notice: Undefined variable: a in /in/SOIAL on line 3 Warning: Division by zero in /in/SOIAL on line 3 bool(false) object(stdClass)#1 (0) { } Fatal error: Class 'Datetime' not found in /in/SOIAL on line 6
Process exited with code 255.
Output for 5.0.0 - 5.0.3
Notice: Use of undefined constant stdclass - assumed 'stdclass' in /in/SOIAL on line 3 Notice: Undefined variable: a in /in/SOIAL on line 3 Warning: Division by zero in /in/SOIAL on line 3 bool(false) object(stdClass)#1 (0) { } Fatal error: Class 'Datetime' not found in /in/SOIAL on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Notice: Use of undefined constant stdclass - assumed 'stdclass' in /in/SOIAL on line 3 Notice: Undefined variable: a in /in/SOIAL on line 3 Warning: Division by zero in /in/SOIAL on line 3 bool(false) object(stdClass)(0) { } Fatal error: Cannot instantiate non-existent class: datetime in /in/SOIAL on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Use of undefined constant stdclass - assumed 'stdclass' in /in/SOIAL on line 3 Notice: Undefined variable: a in /in/SOIAL on line 3 Warning: Division by zero in /in/SOIAL on line 3 bool(false) object(stdClass)(0) { } Fatal error: Cannot instantiate non-existent class: datetime in /in/SOIAL on line 6