3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sampleArray = [ ["id" => 0.1, "marks" => 2], ["id" => 0.2, "marks" => 4], ["id" => 0.3, "marks" => 1], ["id" => 1.1, "marks" => 6], ["id" => 1.2, "marks" => 0], ["id" => 1.3, "marks" => 8], ["id" => 2.1, "marks" => 7], ["id" => 2.2, "marks" => 12], ]; $result = []; foreach ($sampleArray as $row) { $result[$row['id']] = ($result[$row['id']] ?? 0) + $row['marks']; } 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.4.130.0140.00518.77
8.4.120.0130.00724.13
8.4.110.0160.00419.01
8.4.100.0110.01018.70
8.4.90.0150.00520.36
8.4.80.0130.00717.81
8.4.70.0020.00717.80
8.4.60.0100.01018.72
8.4.50.0150.00719.68
8.4.40.0130.00620.64
8.4.30.0030.00620.67
8.4.20.0060.00320.87
8.4.10.0060.00319.46
8.3.260.0100.00316.53
8.3.250.0080.01118.88
8.3.240.0100.00817.30
8.3.230.0060.01316.58
8.3.220.0140.00519.04
8.3.210.0020.00616.76
8.3.200.0060.00316.80
8.3.190.0050.00317.26
8.3.180.0060.00516.69
8.3.170.0070.01118.89
8.3.160.0150.00416.59
8.3.150.0180.00020.60
8.3.140.0060.00317.12
8.3.130.0080.00018.29
8.3.120.0040.00718.58
8.3.110.0080.00020.94
8.3.100.0090.00024.06
8.3.90.0090.00626.77
8.3.80.0090.00016.75
8.3.70.0160.00716.88
8.3.60.0120.00318.35
8.3.50.0100.00716.30
8.3.40.0100.01018.74
8.3.30.0080.00818.68
8.3.20.0040.00424.18
8.3.10.0050.00324.66
8.3.00.0080.00026.16
8.2.290.0110.00920.19
8.2.280.0050.00418.57
8.2.270.0090.00918.95
8.2.260.0000.00719.11
8.2.250.0040.01116.53
8.2.240.0060.00317.32
8.2.230.0080.00022.58
8.2.220.0160.00037.54
8.2.210.0000.00726.77
8.2.200.0030.00618.29
8.2.190.0170.00018.56
8.2.180.0090.01225.92
8.2.170.0070.01019.21
8.2.160.0070.00722.96
8.2.150.0000.00725.66
8.2.140.0050.00224.66
8.2.130.0040.00426.16
8.2.120.0080.00026.16
8.2.110.0050.00520.38
8.2.100.0070.00417.97
8.2.90.0090.00019.35
8.2.80.0030.00617.97
8.2.70.0040.00417.63
8.2.60.0050.00317.93
8.2.50.0000.00818.07
8.2.40.0040.00420.07
8.2.30.0040.00418.04
8.2.20.0040.00418.11
8.2.10.0030.00519.38
8.2.00.0040.00419.37
8.1.330.0110.00721.84
8.1.320.0100.00916.25
8.1.310.0060.00916.80
8.1.300.0090.00018.45
8.1.290.0100.00030.84
8.1.280.0120.00625.92
8.1.270.0060.00323.99
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00322.05
8.1.230.0000.01120.90
8.1.220.0040.00417.77
8.1.210.0050.00318.77
8.1.200.0000.00917.00
8.1.190.0000.00817.22
8.1.180.0000.00818.10
8.1.170.0000.00818.47
8.1.160.0000.00718.91
8.1.150.0030.00618.87
8.1.140.0000.00718.77
8.1.130.0030.00320.14
8.1.120.0040.00417.46
8.1.110.0040.00417.50
8.1.100.0070.00317.51
8.1.90.0030.00617.48
8.1.80.0020.01117.35
8.1.70.0070.00017.49
8.1.60.0090.00017.53
8.1.50.0040.00417.49
8.1.40.0000.00817.55
8.1.30.0040.00417.59
8.1.20.0080.00017.59
8.1.10.0070.00417.49
8.1.00.0000.00717.54
8.0.300.0070.00018.77
8.0.290.0050.00216.63
8.0.280.0000.00718.49
8.0.270.0030.00317.92
8.0.260.0000.00618.45
8.0.250.0080.00016.92
8.0.240.0050.00317.01
8.0.230.0040.00416.96
8.0.220.0070.00016.89
8.0.210.0000.00716.87
8.0.200.0040.00416.84
8.0.190.0050.00316.86
8.0.180.0030.00316.82
8.0.170.0040.00416.89
8.0.160.0000.00816.83
8.0.150.0040.00416.90
8.0.140.0040.00416.87
8.0.130.0060.00013.20
8.0.120.0030.00516.87
8.0.110.0060.00316.80
8.0.100.0000.00716.75
8.0.90.0040.00416.79
8.0.80.0140.01416.84
8.0.70.0160.01016.80
8.0.60.0260.01116.84
8.0.50.0370.01116.80
8.0.30.0220.01516.89
8.0.20.0150.01816.86
8.0.10.0310.00716.95
8.0.00.0130.01316.98
7.4.330.0040.00015.55
7.4.320.0000.00616.52
7.4.300.0000.00616.59
7.4.290.0000.00716.59
7.4.280.0000.00716.62
7.4.270.0030.00316.60
7.4.260.0030.00316.62
7.4.250.0070.00016.48
7.4.240.0000.00716.43
7.4.230.0030.00316.61
7.4.220.0130.00316.57
7.4.210.0200.01116.65
7.4.200.0200.00716.50
7.4.190.0220.00416.62
7.4.180.0280.00316.66
7.4.160.0210.00516.45
7.4.150.0180.01216.48
7.4.140.0400.00616.47
7.4.130.0140.01816.41
7.4.120.0230.01316.46
7.4.110.0240.00816.39
7.4.100.0270.00516.56
7.4.90.0210.00616.49
7.4.80.0230.01116.32
7.4.70.0150.01816.25
7.4.60.0200.01016.38
7.4.50.0250.00616.29
7.4.40.0410.00016.28
7.4.30.0150.01116.44
7.4.20.0210.01116.28
7.4.10.0210.00916.62
7.4.00.0260.00616.39
7.3.330.0070.00016.36
7.3.320.0000.00713.07
7.3.310.0000.00716.27
7.3.300.0030.00316.13
7.3.290.0170.01216.18
7.3.280.0180.00916.26
7.3.270.0120.01516.30
7.3.260.0180.01416.41
7.3.250.0290.00616.34
7.3.240.0280.00616.25
7.3.230.0120.02116.28
7.3.220.0280.00316.17
7.3.210.0240.01016.23
7.3.200.0210.00916.18
7.3.190.0260.00516.18
7.3.180.0250.00616.21
7.3.170.0280.00316.24
7.3.160.0290.00516.19
7.3.150.0330.00616.18
7.3.140.0140.01416.18
7.3.130.0270.00216.22
7.3.120.0170.01016.21
7.3.110.0240.00416.22
7.3.100.0280.00316.11
7.3.90.0240.00716.41
7.3.80.0210.01516.30
7.3.70.0230.01016.33
7.3.60.0230.00916.52
7.3.50.0180.01616.40
7.3.40.0180.01216.39
7.3.30.0150.01116.38
7.3.20.0180.01116.46
7.3.10.0190.01416.32
7.3.00.0430.00316.36

preferences:
27.41 ms | 403 KiB | 5 Q