3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $obj = new stdClass; $s = var_export($obj , true); echo $s; eval('$my_var=' . $s . ';'); var_dump($my_var);
Output for 7.0.0 - 7.1.0
stdClass::__set_state(array( )) Fatal error: Uncaught Error: Call to undefined method stdClass::__set_state() in /in/OB9b0(6) : eval()'d code:1 Stack trace: #0 /in/OB9b0(6): eval() #1 {main} thrown in /in/OB9b0(6) : eval()'d code on line 1
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
stdClass::__set_state(array( )) Fatal error: Call to undefined method stdClass::__set_state() in /in/OB9b0(6)(309711771b961f64216b1d97dbe05706) : eval()'d code on line 2
Process exited with code 255.
Output for 5.1.0 - 5.6.28
stdClass::__set_state(array( )) Fatal error: Call to undefined method stdClass::__set_state() in /in/OB9b0(6) : eval()'d code on line 1
Process exited with code 255.
Output for 5.0.4 - 5.0.5
class stdClass { } Parse error: parse error, unexpected T_CLASS in /in/OB9b0(6) : eval()'d code on line 1 Notice: Undefined variable: my_var in /in/OB9b0 on line 8 NULL
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.3
class stdClass { } Parse error: parse error, unexpected T_CLASS in /in/OB9b0(6) : eval()'d code on line 1 Notice: Undefined variable: my_var in /in/OB9b0 on line 8 NULL
Process exited with code 255.
Output for 4.4.2 - 4.4.9
class stdClass { } Parse error: syntax error, unexpected T_CLASS in /in/OB9b0(6) : eval()'d code on line 1 Notice: Undefined variable: my_var in /in/OB9b0 on line 8 NULL
Process exited with code 255.
Output for 4.3.2 - 4.3.4
class stdClass { } Parse error: parse error in /in/OB9b0(6) : eval()'d code on line 1 Notice: Undefined variable: my_var in /in/OB9b0 on line 8 NULL
Process exited with code 255.