3v4l.org

run code in 300+ PHP versions simultaneously
<?php $items = [ ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ['a' => 'a', 'b' => 'b', 'c'=> 'c', 'd'=>'d', 'e'=>'e', 'f'=>'f'], ]; $iterations = 1000; $start = microtime(true); for ($i=0 ; $i<$iterations ; $i++) { $reduced = array_reduce($items, fn($carry, $scope_items) => [...$carry, ...array_values($scope_items)], []); } $split = microtime(true); for ($i=0 ; $i<$iterations ; $i++) { $item_sets = []; foreach ($items as $scope_items) { $item_sets[] = array_values($scope_items); } $looped = array_merge(...$item_sets); } $end = microtime(TRUE); echo "Reduce: " . ($split-$start)/$iterations . " sec\n"; echo "Merge: " . ($end-$split)/$iterations . " sec\n";

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.1.240.0140.26919.50

preferences:
29 ms | 403 KiB | 5 Q