3v4l.org

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