3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [1, 2014, 'context' => 'aaa'], [12, 2014, 'context' => 'aaa'], [5, 2014, 'context' => 'zzz'], ]; foreach ($array as $i => &$row) { if (!isset($ref[$row['context']])) { $ref[$row['context']] = &$row[0]; } else { $ref[$row['context']] += $row[0]; unset($array[$i]); } } var_export($array);

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.0140.00720.02
8.4.150.0020.00114.05
8.4.140.0050.00317.72
8.4.130.0150.00419.41
8.4.120.0110.00924.06
8.4.110.0090.01022.52
8.4.100.0120.00917.59
8.4.90.0080.01018.51
8.4.80.0050.00418.09
8.4.70.0130.00917.95
8.4.60.0110.01118.88
8.4.50.0100.01119.59
8.4.40.0090.00620.48
8.4.30.0090.00922.13
8.4.20.0130.00719.49
8.4.10.0100.01021.97
8.3.280.0090.01018.43
8.3.270.0110.00816.86
8.3.260.0150.00416.73
8.3.250.0130.00619.20
8.3.240.0120.00817.08
8.3.230.0110.00816.61
8.3.220.0110.00817.27
8.3.210.0080.00216.69
8.3.200.0050.00416.73
8.3.190.0100.00817.07
8.3.180.0100.00816.72
8.3.170.0060.00319.02
8.3.160.0110.00718.57
8.3.150.0110.00719.01
8.3.140.0080.00016.46
8.3.130.0120.00318.63
8.3.120.0030.00620.86
8.3.110.0000.00916.52
8.3.100.0050.00518.58
8.3.90.0040.00426.77
8.3.80.0040.00417.97
8.3.70.0070.01416.63
8.3.60.0150.00616.75
8.3.50.0090.00616.74
8.3.40.0130.00323.40
8.3.30.0030.01218.84
8.3.20.0070.00024.18
8.3.10.0000.00824.66
8.3.00.0040.00426.16
8.2.290.0100.00320.80
8.2.280.0070.00918.22
8.2.270.0140.00317.24
8.2.260.0150.00016.29
8.2.250.0050.00516.69
8.2.240.0090.00617.13
8.2.230.0100.00020.94
8.2.220.0080.00024.06
8.2.210.0070.00426.77
8.2.200.0030.00618.41
8.2.190.0040.01216.63
8.2.180.0060.00916.75
8.2.170.0080.00818.91
8.2.160.0100.00322.96
8.2.150.0080.00025.66
8.2.140.0080.00024.66
8.2.130.0000.00726.16
8.2.120.0040.00421.18
8.2.110.0030.01321.07
8.2.100.0060.00617.91
8.2.90.0040.00417.75
8.2.80.0040.00418.92
8.2.70.0000.00817.50
8.2.60.0130.00617.63
8.2.50.0140.00517.48
8.2.40.0120.00617.48
8.2.30.0140.00317.38
8.2.20.0130.00417.50
8.2.10.0140.00317.60
8.2.00.0120.00417.38
8.1.330.0100.00821.94
8.1.320.0090.01116.08
8.1.310.0120.00316.82
8.1.300.0060.00320.29
8.1.290.0030.00630.84
8.1.280.0120.00325.92
8.1.270.0040.00424.66
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0000.01023.86
8.1.230.0030.00920.81
8.1.220.0000.00818.64
8.1.210.0060.00318.77
8.1.200.0060.00317.36
8.1.190.0160.00217.00
8.1.180.0150.00416.86
8.1.170.0200.00017.25
8.1.160.0150.00417.23
8.1.150.0170.00017.38
8.1.140.0120.00617.00
8.1.130.0150.00517.13
8.1.120.0150.00517.09
8.1.110.0250.00017.25
8.1.100.0140.00417.21
8.1.90.0080.00817.46
8.1.80.0170.00017.25
8.1.70.0130.00317.00
8.1.60.0190.00017.48
8.1.50.0100.01017.38
8.1.40.0150.00517.36
8.1.30.0140.00417.50
8.1.20.0150.00517.25
8.1.10.0100.00817.25
8.1.00.0190.00017.13
8.0.300.0040.00419.95
8.0.290.0070.00016.58
8.0.280.0100.00716.52
8.0.270.0140.00416.61
8.0.260.0110.00616.52
8.0.250.0180.00016.52
8.0.240.0110.00716.63
8.0.230.0130.00416.59
8.0.220.0140.00516.63
8.0.210.0130.00516.60
8.0.200.0170.00316.52
8.0.190.0090.00916.63
8.0.180.0140.00316.71
8.0.170.0160.00016.61
8.0.160.0100.01016.62
8.0.150.0120.00416.74
8.0.140.0110.00616.75
8.0.130.0130.00316.52
8.0.120.0100.00616.52
8.0.110.0120.00416.59
8.0.100.0170.00016.52
8.0.90.0080.00816.52
8.0.80.0040.01416.52
8.0.70.0050.01116.59
8.0.60.0110.00616.52
8.0.50.0080.00816.52
8.0.30.0050.01116.52
8.0.20.0080.00816.75
8.0.10.0110.00616.63

preferences:
37.29 ms | 403 KiB | 5 Q