3v4l.org

run code in 150+ 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 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [0] => leg1:LA [1] => leg2:NY [2] => leg3:NY [3] => leg4:FL )