3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $daysOfWeek = array('nd','pon','wt','sr','czw','pt','so'); foreach($daysOfWeek as $key=>$value) { echo $key.' '.$value; } $converted = array(); foreach ($daysOfWeek as $key=>$checked) { $converted[++$key] = $checked; } $converted[0] = $converted[7]; unset($converted[7]); print_r($converted);
based on YJ8Cp
Output for 4.3.0 - 7.3.1
0 nd1 pon2 wt3 sr4 czw5 pt6 soArray ( [1] => nd [2] => pon [3] => wt [4] => sr [5] => czw [6] => pt [0] => so )