3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = array('leg1'=>'LA', 'leg2'=>'NY', 'leg3'=>'NY', 'leg4'=>'FL'); while(current($a)) { $output[] = key($a) . ":" . current($a); next($a); $output[] = key($a) . ":" . current($a); next($a); } print_r($output);
Output for 4.3.0 - 7.2.0
Array ( [0] => leg1:LA [1] => leg2:NY [2] => leg3:NY [3] => leg4:FL )