3v4l.org

run code in 200+ 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 - 7.2.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