3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php if (1==1) { $sql = "some sql statement $tmp[id]"; echo $sql; } //^ that is not working $sql prints as empty but if I do : if (1==1) { $anything = $tmp['id']; $sql = "some sql statement $tmp[id]"; echo $sql; }
based on YWMKP
Output for 5.0.4 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Notice: Undefined variable: tmp in /in/sKZEI on line 3 some sql statement Notice: Undefined variable: tmp in /in/sKZEI on line 10 Notice: Undefined variable: tmp in /in/sKZEI on line 11 some sql statement
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: tmp in /in/sKZEI on line 3 some sql statement Notice: Undefined variable: tmp in /in/sKZEI on line 10 Notice: Undefined variable: tmp in /in/sKZEI on line 11 some sql statement