3v4l.org

run code in 300+ PHP versions simultaneously
<?php $langs = [ 5 => "english", 10 => "french", 12 => "german" ]; $posts = [ [ "date" => "13-07-2022", "lang_id" => 5, "amount" => 90, ], [ "date" => "13-07-2022", "lang_id" => 10, "amount" => 34, ], [ "date" => "14-07-2022", "lang_id" => 5, "amount" => 7, ], ]; $defaults = array_fill_keys($langs, 0); $result = []; foreach ($posts as $row) { extract($row); $result[$date] ??= ['date' => $date] + $defaults; $result[$date][$langs[$lang_id]] += $amount; } var_export(array_values($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.00.0120.01019.89
8.4.150.0030.00014.05
8.4.140.0120.00917.52
8.4.130.0070.00817.48
8.4.120.0110.00920.67
8.4.110.0120.00822.46
8.4.100.0130.00820.58
8.4.90.0110.01020.61
8.4.80.0150.00717.70
8.4.70.0140.00617.80
8.4.60.0080.01119.02
8.4.50.0120.00818.54
8.4.40.0180.00617.90
8.4.30.0110.00718.63
8.4.20.0160.00020.59
8.4.10.0060.00319.38
8.3.280.0140.01018.34
8.3.270.0150.00516.65
8.3.260.0150.00416.25
8.3.250.0120.00718.97
8.3.240.0140.00516.64
8.3.230.0080.00216.85
8.3.220.0040.00519.07
8.3.210.0090.01116.58
8.3.200.0040.00416.58
8.3.190.0030.00617.18
8.3.180.0040.00416.59
8.3.170.0090.00918.96
8.3.160.0140.00416.55
8.3.150.0120.00918.49
8.3.140.0050.00316.57
8.3.130.0160.00318.63
8.3.120.0090.00618.92
8.3.110.0030.00520.94
8.3.100.0060.00324.06
8.3.90.0070.00026.77
8.3.80.0050.00518.31
8.3.70.0090.00616.75
8.3.60.0140.00418.42
8.3.50.0000.01418.61
8.3.40.0160.00321.84
8.3.30.0130.00320.50
8.3.20.0000.00824.18
8.3.10.0050.00224.66
8.3.00.0050.00326.16
8.2.290.0110.00720.47
8.2.280.0120.00918.30
8.2.270.0180.00017.25
8.2.260.0040.01418.35
8.2.250.0000.00816.66
8.2.240.0090.00017.30
8.2.230.0030.00622.58
8.2.220.0080.00337.54
8.2.210.0000.00826.77
8.2.200.0030.00616.63
8.2.190.0170.00716.63
8.2.180.0100.00716.72
8.2.170.0070.01118.95
8.2.160.0090.00922.96
8.2.150.0040.00425.66
8.2.140.0050.00324.66
8.2.130.0070.00426.16
8.2.120.0030.00621.25
8.2.110.0130.00620.47
8.2.100.0120.00819.18
8.2.90.0210.01218.89
8.2.80.0200.00718.77
8.2.70.0300.00718.77
8.2.60.0210.00718.89
8.2.50.0170.01419.97
8.2.40.0210.00618.90
8.2.30.0210.00018.82
8.2.20.0180.00019.03
8.2.10.0200.01019.04
8.2.00.0240.00718.79
8.1.330.0110.00721.84
8.1.320.0100.00916.34
8.1.310.0080.00016.53
8.1.300.0150.00315.93
8.1.290.0080.00030.84
8.1.280.0040.01125.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0270.00618.53
8.1.230.0270.00818.34
8.1.220.0290.00618.59
8.1.210.0190.00619.66
8.1.200.0200.00718.54
8.1.190.0240.00318.45
8.1.180.0130.00318.42
8.1.170.0060.00918.37
8.1.160.0110.00518.70
8.1.150.0080.00420.42
8.1.140.0090.00418.55
8.1.130.0050.00918.56
8.1.120.0090.00318.54
8.1.110.0200.00719.73
8.1.100.0130.00318.56
8.1.90.0040.00918.67
8.1.80.0090.00418.52
8.1.70.0120.00918.61
8.1.60.0130.00318.75
8.1.50.0150.00018.68
8.1.40.0100.00318.92
8.1.30.0080.00519.02
8.1.20.0130.00018.78
8.1.10.0040.00818.82
8.1.00.0130.00018.50
8.0.300.0120.00317.92
8.0.290.0120.00317.74
8.0.280.0090.00617.89
8.0.270.0120.00617.90
8.0.260.0090.00318.13
8.0.250.0040.01217.81
8.0.240.0120.00317.71
8.0.230.0090.00318.09
8.0.220.0090.00617.89
8.0.210.0140.00017.80
8.0.200.0150.00018.05
8.0.190.0000.01218.40
8.0.180.0110.00317.86
8.0.170.0110.00417.92
8.0.160.0150.00018.04
8.0.150.0120.00317.73
8.0.140.0110.00418.00
8.0.130.0120.00018.25
8.0.120.0150.00017.88
8.0.110.0140.00018.08
8.0.100.0150.00018.00
8.0.90.0150.00017.88
8.0.80.0070.00717.94
8.0.70.0100.00517.89
8.0.60.0080.00418.27
8.0.50.0060.00918.00
8.0.30.0120.00018.41
8.0.20.0090.00618.01
8.0.10.0150.00018.09

preferences:
85.19 ms | 403 KiB | 5 Q