3v4l.org

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