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)) { echo $current . "\n"; if(next($a) == $current && next($a) == $current){ //staying put for next two legs echo "Match!\n"; } }
Output for 4.3.0 - 7.1.0
LA NY Match! NY FL