3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $x = array(1,2,3); eval("$x->foo();"); var_dump($x === array(1,2,3));
based on AJimu
Output for 7.0.0 - 7.1.0
Notice: Trying to get property of non-object in /in/q1IeH on line 4 Parse error: syntax error, unexpected ')' in /in/q1IeH(4) : eval()'d code on line 1
Process exited with code 255.
Output for 5.4.11 - 5.6.28
Notice: Trying to get property of non-object in /in/q1IeH on line 4 Parse error: syntax error, unexpected ')' in /in/q1IeH(4) : eval()'d code on line 1 bool(true)
Output for 5.1.0 - 5.4.10
Notice: Trying to get property of non-object in /in/q1IeH on line 4 Parse error: syntax error, unexpected ')' in /in/q1IeH(4) : eval()'d code on line 1 bool(true)
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Notice: Trying to get property of non-object in /in/q1IeH on line 4 Parse error: parse error, unexpected ')' in /in/q1IeH(4) : eval()'d code on line 1 bool(true)
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected ')' in /in/q1IeH(4) : eval()'d code on line 1 bool(true)
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected ')' in /in/q1IeH(4) : eval()'d code on line 1 bool(true)
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/q1IeH(4) : eval()'d code on line 1 bool(true)
Process exited with code 255.