3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sorted = [ [ ['Year' => "2020", 'Month' => "Feb", 'Analyzed' => 23, 'Account' => 225,], ['Year' => "2021", 'Month' => "Feb", 'Analyzed' => 23, 'Account' => 125,], ['Year' => "2022", 'Month' => "Feb", 'Analyzed' => 23, 'Account' => 425,], ], [ ['Year' => "2020", 'Month' => "Feb", 'Analyzed' => 23, 'Account' => 55,], ['Year' => "2021", 'Month' => "Feb", 'Analyzed' => 23, 'Account' => 33,], ['Year' => "2022", 'Month' => "Feb", 'Analyzed' => 23, 'Account' => 44,], ], ]; $sorted_Rcv = [ [ ['Year' => "2020", 'Month' => "Feb", 'Received' => 12, 'Account' => 225,], ['Year' => "2021", 'Month' => "Feb", 'Received' => 33, 'Account' => 125,], ['Year' => "2022", 'Month' => "Feb", 'Received' => 11, 'Account' => 425,], ], [ ['Year' => "2020", 'Month' => "Feb", 'Received' => 12, 'Account' => 55,], ['Year' => "2021", 'Month' => "Feb", 'Received' => 33, 'Account' => 33,], ['Year' => "2022", 'Month' => "Feb", 'Received' => 11, 'Account' => 44,], ], ]; $merged_result = array(); foreach($sorted as $subar1){ foreach($subar1 as $val){ foreach($sorted_Rcv as $subar2){ foreach($subar2 as $val2){ if ($val['Year'] == $val2['Year'] && $val['Month'] == $val2['Month'] && $val['Account'] == $val2['Account']){ $merged_result[] = [ 'Year' => $val2['Year'], 'Month' => $val2['Month'], 'Account' => $val2['Account'], 'Analyzed' => $val['Analyzed'], 'Received' => $val2['Received'], ]; } } } } } print_r($merged_result);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [Year] => 2020 [Month] => Feb [Account] => 225 [Analyzed] => 23 [Received] => 12 ) [1] => Array ( [Year] => 2021 [Month] => Feb [Account] => 125 [Analyzed] => 23 [Received] => 33 ) [2] => Array ( [Year] => 2022 [Month] => Feb [Account] => 425 [Analyzed] => 23 [Received] => 11 ) [3] => Array ( [Year] => 2020 [Month] => Feb [Account] => 55 [Analyzed] => 23 [Received] => 12 ) [4] => Array ( [Year] => 2021 [Month] => Feb [Account] => 33 [Analyzed] => 23 [Received] => 33 ) [5] => Array ( [Year] => 2022 [Month] => Feb [Account] => 44 [Analyzed] => 23 [Received] => 11 ) )

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:
60.44 ms | 403 KiB | 8 Q