3v4l.org

run code in 500+ PHP versions simultaneously
<?php $list = [ [ 'name' => 'blah', 'path' => 'A' ], [ 'name' => 'blah', 'path' => 'AA' ], [ 'name' => 'blah', 'path' => 'AB' ], [ 'name' => 'blah', 'path' => 'B' ], [ 'name' => 'blah', 'path' => 'BA' ], [ 'name' => 'blah', 'path' => 'BAA' ], ]; $result = array_reduce($list, function ($a, $c) { $l = substr($c['path'], 0, 1); isset($a[$l]) ? $a[$l]['children'][] = $c : $a[$l] = [ 'name' => $c['name'], 'path' => $c['path'], 'children' => [] ]; return $a; }, []); // to remove the letter keys, uncomment the next line // $result = array_values($result); var_export($result);

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.5.70.0140.00416.94
8.5.60.0110.00616.91
8.5.50.0050.00216.81
8.5.30.0150.00818.96
8.5.20.0070.01019.43
8.5.10.0100.00820.14
8.5.00.0130.00819.98
8.4.180.0120.01022.10
8.4.170.0110.01119.74
8.4.160.0130.01022.28
8.4.150.0100.00416.83
8.4.140.0110.01017.54
8.4.130.0100.01017.77
8.4.120.0100.00923.94
8.4.110.0090.00922.36
8.4.100.0100.01019.07
8.4.90.0050.00519.04
8.4.80.0070.00118.67
8.4.70.0100.01117.82
8.4.60.0140.00618.98
8.4.50.0060.00318.54
8.4.40.0100.00017.70
8.4.30.0060.00318.71
8.4.20.0060.01322.18
8.4.10.0100.00723.87
8.3.300.0110.01120.35
8.3.290.0120.00920.83
8.3.280.0080.01220.02
8.3.270.0120.00716.73
8.3.260.0110.00516.75
8.3.250.0150.00318.92
8.3.240.0120.00817.16
8.3.230.0120.00616.60
8.3.220.0090.01019.18
8.3.210.0040.00318.56
8.3.200.0040.00516.35
8.3.190.0070.01417.34
8.3.180.0120.01016.70
8.3.170.0120.00620.57
8.3.160.0120.00617.19
8.3.150.0040.01417.04
8.3.140.0040.00416.50
8.3.130.0040.00416.61
8.3.120.0060.00320.80
8.3.110.0000.00816.53
8.3.100.0050.00518.29
8.3.90.0030.01326.77
8.3.80.0000.01018.31
8.3.70.0100.00716.58
8.3.60.0090.00918.30
8.3.50.0120.00620.21
8.3.40.0140.00020.34
8.3.30.0140.00018.44
8.3.20.0090.00024.18
8.3.10.0030.00524.66
8.3.00.0050.00326.16
8.2.300.0140.00822.18
8.2.290.0120.00620.60
8.2.280.0040.00518.46
8.2.270.0150.00418.93
8.2.260.0090.00618.25
8.2.250.0000.01016.63
8.2.240.0030.00618.59
8.2.230.0050.00320.94
8.2.220.0080.00024.06
8.2.210.0090.00926.77
8.2.200.0060.00318.29
8.2.190.0080.00816.58
8.2.180.0040.01125.92
8.2.170.0140.00418.91
8.2.160.0140.00022.96
8.2.150.0050.00325.66
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0080.00026.16
8.2.110.0030.00620.53
8.2.100.0030.00620.16
8.1.340.0110.01121.82
8.1.330.0110.00721.95
8.1.320.0110.00816.28
8.1.310.0060.00318.31
8.1.300.0050.00516.87
8.1.290.0040.00730.84
8.1.280.0120.00325.92
8.1.270.0080.00024.66
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0070.00318.58
8.1.230.0030.00718.45
7.4.320.0040.00416.54

preferences:
54.96 ms | 912 KiB | 5 Q