3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array(1, 2, 3, 4, 5 ); $step = 2; function myfunc($key, $value) { if ($key == $step) echo ' $ '; echo "$value "; } array_walk($a, 'myfunc');
Output for 5.0.4 - 7.1.0
Notice: Undefined variable: step in /in/6LXGY on line 7 0 Notice: Undefined variable: step in /in/6LXGY on line 7 1 Notice: Undefined variable: step in /in/6LXGY on line 7 2 Notice: Undefined variable: step in /in/6LXGY on line 7 3 Notice: Undefined variable: step in /in/6LXGY on line 7 4
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: step in /in/6LXGY on line 7 0 Notice: Undefined variable: step in /in/6LXGY on line 7 1 Notice: Undefined variable: step in /in/6LXGY on line 7 2 Notice: Undefined variable: step in /in/6LXGY on line 7 3 Notice: Undefined variable: step in /in/6LXGY on line 7 4