3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [['range' => 336, 'year' => 2020],['range' => 336, 'year' => 2020],['range' => 390, 'year' => 2020],['range' => 390, 'year' => 2021]]; $idList = array_flip(array_values(array_unique(array_column($array, 'range')))); $newDatesCurrent = []; foreach($array as $value) { $newDatesCurrent[] = ['range' => $idList[$value['range']], 'year' => $value['year'], 'month' => 222]; } print_r($newDatesCurrent);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [range] => 0 [year] => 2020 [month] => 222 ) [1] => Array ( [range] => 0 [year] => 2020 [month] => 222 ) [2] => Array ( [range] => 1 [year] => 2020 [month] => 222 ) [3] => Array ( [range] => 1 [year] => 2021 [month] => 222 ) )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
38.28 ms | 402 KiB | 8 Q