3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['city' => 'NewYork', 'cash' => '1000'], ['city' => 'Philadelphia', 'cash' => '2300'], ['city' => 'NewYork', 'cash' => '2000'] ]; foreach ($array as $row) { $result[$row['city']] = [ 'city' => $row['city'], 'cash' => ($result[$row['city']]['cash'] ?? 0) + $row['cash'] ]; } 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.0110.01220.17
8.4.150.0020.00014.05
8.4.140.0170.00717.66
8.4.130.0070.00517.94
8.4.120.0120.00820.13
8.4.110.0100.01022.30
8.4.100.0100.00718.87
8.4.90.0080.01220.66
8.4.80.0050.00420.67
8.4.70.0140.00518.05
8.4.60.0070.00519.12
8.4.50.0060.00320.25
8.4.40.0030.01717.64
8.4.30.0130.00718.73
8.4.20.0110.00717.91
8.4.10.0030.00619.55
8.3.280.0140.00718.50
8.3.270.0090.01016.57
8.3.260.0140.00516.40
8.3.250.0130.00719.10
8.3.240.0090.01116.49
8.3.230.0080.00216.51
8.3.220.0100.00618.84
8.3.210.0130.00616.49
8.3.200.0060.00316.57
8.3.190.0050.00217.17
8.3.180.0100.01016.43
8.3.170.0150.00317.09
8.3.160.0090.00919.04
8.3.150.0090.00016.60
8.3.140.0030.00618.97
8.3.130.0030.00718.44
8.3.120.0030.01320.49
8.3.110.0090.00020.94
8.3.100.0090.00024.06
8.3.90.0080.00026.77
8.3.80.0070.00319.36
8.3.70.0070.00718.43
8.3.60.0150.00618.27
8.3.50.0110.00424.58
8.3.40.0140.00021.76
8.3.30.0160.00018.90
8.3.20.0070.00024.18
8.3.10.0000.00824.66
8.3.00.0050.00326.16
8.2.290.0070.01020.45
8.2.280.0100.00818.29
8.2.270.0120.00617.34
8.2.260.0040.00418.29
8.2.250.0040.00418.47
8.2.240.0090.00616.87
8.2.230.0030.00622.58
8.2.220.0120.00337.54
8.2.210.0140.00326.77
8.2.200.0040.00418.88
8.2.190.0090.00618.02
8.2.180.0190.00025.92
8.2.170.0090.00919.08
8.2.160.0130.00722.96
8.2.150.0040.00425.66
8.2.140.0000.00724.66
8.2.130.0060.00326.16
8.2.120.0000.00721.04
8.2.110.0070.01020.25
8.2.100.0090.00317.93
8.2.90.0030.00519.40
8.2.80.0030.00617.97
8.2.70.0030.00717.75
8.2.60.0030.00717.93
8.2.50.0060.00318.10
8.2.40.0060.00320.60
8.2.30.0000.00718.00
8.2.20.0040.00418.12
8.2.10.0000.00819.25
8.2.00.0040.00419.20
8.1.330.0060.00616.18
8.1.320.0120.00617.97
8.1.310.0050.00318.36
8.1.300.0030.00519.94
8.1.290.0030.00630.84
8.1.280.0150.00025.92
8.1.270.0000.00823.99
8.1.260.0030.00526.35
8.1.250.0080.00028.09
8.1.240.0110.00017.48
8.1.230.0070.00418.98
8.1.220.0000.00817.76
8.1.210.0030.00518.77
8.1.200.0070.00317.35
8.1.190.0060.00317.22
8.1.180.0040.00418.10
8.1.170.0050.00218.55
8.1.160.0070.00023.96
8.1.150.0040.00418.90
8.1.140.0070.00018.85
8.1.130.0030.00320.17
8.1.120.0040.00417.35
8.1.110.0040.00417.34
8.1.100.0040.00417.42
8.1.90.0030.00517.44
8.1.80.0060.00417.50
8.1.70.0000.00817.48
8.1.60.0100.00517.54
8.1.50.0040.00417.46
8.1.40.0040.00417.54
8.1.30.0000.00817.61
8.1.20.0140.00217.66
8.1.10.0030.00517.48
8.1.00.0030.00517.27
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0030.00318.45
8.0.270.0000.00718.07
8.0.260.0030.00318.48
8.0.250.0000.00717.02
8.0.240.0000.00817.04
8.0.230.0030.00316.93
8.0.220.0030.00516.98
8.0.210.0060.00316.97
8.0.200.0000.00617.05
8.0.190.0000.00717.02
8.0.180.0040.00416.96
8.0.170.0000.00816.90
8.0.160.0000.00816.99
8.0.150.0080.00016.86
8.0.140.0000.00816.89
8.0.130.0030.00313.36
8.0.120.0050.00316.91
8.0.110.0070.00416.89
8.0.100.0040.00416.79
8.0.90.0000.00716.90
8.0.80.0120.00716.98
8.0.70.0040.00416.96
8.0.60.0040.00416.94
8.0.50.0000.00716.80
8.0.30.0060.01017.11
8.0.20.0090.01117.03
8.0.10.0070.01117.09
8.0.00.0070.01216.88
7.4.330.0020.00215.55
7.4.320.0030.00316.57
7.4.300.0030.00316.49
7.4.290.0000.00716.35
7.4.280.0000.00916.55
7.4.270.0030.00316.61
7.4.260.0030.00313.27
7.4.250.0000.00716.45
7.4.240.0000.00716.54
7.4.230.0040.00416.51
7.4.220.0030.00316.48
7.4.210.0040.01116.56
7.4.200.0040.00416.70
7.4.160.0210.00016.53
7.4.150.0040.01016.61
7.4.140.0070.01016.54
7.4.130.0080.01116.32
7.4.120.0100.00716.48
7.4.110.0120.00516.37
7.4.100.0100.00816.54
7.4.90.0100.01016.49
7.4.80.0100.00516.48
7.4.70.0050.01016.46
7.4.60.0080.00816.42
7.4.50.0070.00916.38
7.4.40.0100.00816.27
7.4.30.0100.00516.41
7.4.20.0010.01516.33
7.4.10.0090.00816.43
7.4.00.0130.00616.33
7.3.330.0030.00616.20
7.3.320.0000.00713.25
7.3.310.0070.00016.38
7.3.300.0000.00616.37
7.3.290.0070.00816.32
7.3.280.0090.00616.35
7.3.270.0100.00716.27
7.3.260.0070.00916.35
7.3.250.0160.00016.34
7.3.240.0090.01016.35
7.3.230.0090.00816.41
7.3.220.0110.00616.22
7.3.210.0080.00716.30
7.3.200.0060.01016.39
7.3.190.0100.00816.28
7.3.180.0080.00816.34
7.3.170.0050.01116.44
7.3.160.0070.00816.41
7.3.150.0080.00916.39
7.3.140.0110.00916.32
7.3.130.0080.00716.29
7.3.120.0080.01016.31
7.3.110.0060.00916.13
7.3.100.0100.00616.25
7.3.90.0060.00916.56
7.3.80.0100.01016.24
7.3.70.0070.00816.30
7.3.60.0120.00716.29
7.3.50.0090.00916.26
7.3.40.0060.01016.33
7.3.30.0080.00816.41
7.3.20.0070.00916.32
7.3.10.0060.00916.33
7.3.00.0120.00916.29

preferences:
29.87 ms | 403 KiB | 5 Q