3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = ""; function foo() { return "bar"; } $eval = '$a = ' .foo() . ';'; var_dump($eval); eval($eval); echo $a;
based on SULBh
Output for 7.2.0 - 7.3.0beta1
string(9) "$a = bar;" Warning: Use of undefined constant bar - assumed 'bar' (this will throw an Error in a future version of PHP) in /in/ISKsV(12) : eval()'d code on line 1 bar
Output for 5.5.0 - 7.1.20
string(9) "$a = bar;" Notice: Use of undefined constant bar - assumed 'bar' in /in/ISKsV(12) : eval()'d code on line 1 bar