3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array('leg1'=>'LA', 'leg2'=>'NY', 'leg3'=>'NY', 'leg4'=>'NY', 'leg5'=>'FL'); while($current = current($a)) { if(next($a) == $current && next($a) == $current){ //staying put for next two legs echo $current; } }
Output for 4.3.0 - 7.1.0
NY