3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array('leg1'=>'LA', 'leg2'=>'NY', 'leg3'=>'NY', 'leg4'=>'FL'); do { echo key($a) . ":" . $current; // leg2:NY $next = next($a); echo key($a) . ":" . $next; // leg3:NY $nextnext = next($a); echo key($a) . ":" . $nextnext; // leg4:FL } while($current = next($a));
Output for 5.0.4 - 7.1.0
Notice: Undefined variable: current in /in/Z0jvk on line 5 leg1:leg2:NYleg3:NYleg4:FL::
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: current in /in/Z0jvk on line 5 leg1:leg2:NYleg3:NYleg4:FL::