3v4l.org

run code in 300+ PHP versions simultaneously
<?php $info = array( 10 => 'apple', 8 => 'orange', 2 => 'banana', 23 => 'peach', ); $index = 0; $myGoal = array(); foreach($info as $amount => $friut){ $myGoal[$index] = [$amount => $friut]; $index++; } print_r($myGoal);

preferences:
64.77 ms | 402 KiB | 5 Q