3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fruitpacks = [ ['apples', 3], ['pears', 1], ['apples', 6], ['grapes', 22], ]; abstract class Tools { public static function integerAppend(&$maybeDefined, int $value) { $maybeDefined = ($maybeDefined ?? 0) + $value; } } $totals_by_name = []; foreach ($fruitpacks as [$name, $amount]) { Tools::integerAppend($totals_by_name[$name], $amount); } var_dump($totals_by_name);

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.3.60.0100.00718.47
8.3.50.0000.01516.34
8.3.40.0150.00018.87
8.3.30.0110.00418.84
8.3.20.0040.00420.16
8.3.10.0050.00321.90
8.3.00.0000.00819.38
8.2.180.0140.00418.21
8.2.170.0060.00922.96
8.2.160.0060.00922.13
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0070.00022.29
8.2.120.0040.00426.35
8.2.110.0080.00421.18
8.2.100.0120.00017.97
8.2.90.0090.00019.17
8.2.80.0050.00517.97
8.2.70.0030.00517.50
8.2.60.0070.00218.03
8.2.50.0040.00418.22
8.2.40.0040.00420.45
8.2.30.0040.00419.24
8.2.20.0040.00418.18
8.2.10.0050.00218.18
8.2.00.0000.00718.38
8.1.280.0120.00325.92
8.1.270.0030.00520.00
8.1.260.0000.00726.35
8.1.250.0090.00028.09
8.1.240.0030.00619.21
8.1.230.0110.00017.89
8.1.220.0040.00417.79
8.1.210.0000.00818.77
8.1.200.0100.00017.36
8.1.190.0040.00417.35
8.1.180.0000.00718.10
8.1.170.0040.00418.51
8.1.160.0000.00818.85
8.1.150.0040.00420.72
8.1.140.0000.00717.61
8.1.130.0000.00719.02
8.1.120.0070.00017.49
8.1.110.0000.00817.46
8.1.100.0070.00417.51
8.1.90.0040.00417.43
8.1.80.0070.00017.47
8.1.70.0000.00717.44
8.1.60.0060.00317.59
8.1.50.0080.00317.45
8.1.40.0000.00717.42
8.1.30.0040.00417.59
8.1.20.0030.00717.59
8.1.10.0040.00417.57
8.1.00.0040.00817.40
8.0.300.0060.00318.77
8.0.290.0040.00416.88
8.0.280.0050.00318.48
8.0.270.0000.00717.26
8.0.260.0070.00018.99
8.0.250.0000.00617.00
8.0.240.0060.00317.01
8.0.230.0040.00317.03
8.0.220.0070.00016.85
8.0.210.0070.00016.98
8.0.200.0000.00816.96
8.0.190.0000.00717.00
8.0.180.0040.00416.89
8.0.170.0030.00617.00
8.0.160.0000.00717.04
8.0.150.0000.00817.00
8.0.140.0070.00416.93
8.0.130.0000.00513.34
8.0.120.0070.00016.91
8.0.110.0000.00716.80
8.0.100.0040.00417.06
8.0.90.0070.00016.91
8.0.80.0090.01216.96
8.0.70.0000.00817.00
8.0.60.0000.00716.83
8.0.50.0050.00316.99
8.0.30.0100.01017.03
8.0.20.0140.00817.40
8.0.10.0080.00017.04
8.0.00.0100.00916.92
7.4.330.0000.00515.55
7.4.320.0000.00616.58
7.4.300.0000.00616.57
7.4.290.0030.00316.44
7.4.280.0090.00016.51
7.4.270.0040.00416.53
7.4.260.0000.00716.59
7.4.250.0050.00216.32
7.4.240.0040.00416.52
7.4.230.0070.00016.40
7.4.220.0040.00516.63
7.4.210.0090.00716.52
7.4.200.0000.00716.56
7.4.160.0110.00616.54
7.4.150.0100.01017.40
7.4.140.0110.00917.86
7.4.130.0040.01316.47
7.4.120.0150.00616.52
7.4.110.0070.01616.54
7.4.100.0130.00616.53
7.4.90.0130.00516.27
7.4.80.0050.01119.39
7.4.70.0060.01116.33
7.4.60.0120.00616.55
7.4.50.0070.01016.40
7.4.40.0130.00416.33
7.4.00.0030.00814.83
7.3.330.0000.00613.33
7.3.320.0080.00013.34
7.3.310.0000.00716.39
7.3.300.0040.00416.25
7.3.290.0040.00416.23
7.3.280.0130.00216.39
7.3.270.0080.00917.40
7.3.260.0110.00816.36
7.3.250.0140.00616.47
7.3.240.0090.00916.46
7.3.230.0110.00616.28
7.3.210.0120.00316.73
7.3.200.0090.00816.42
7.3.190.0130.00916.41
7.3.180.0130.00316.28
7.3.170.0140.02416.59
7.3.160.0180.00316.49
7.3.120.0040.01114.89
7.3.110.0040.00414.91
7.3.100.0070.01015.02
7.3.90.0040.01214.49
7.3.80.0040.00814.89
7.3.70.0030.00914.66
7.3.60.0060.00914.88
7.3.50.0060.00914.82
7.3.40.0170.00015.00
7.3.30.0000.01714.91
7.3.20.0080.00816.65
7.3.10.0000.01516.68
7.3.00.0030.01016.73
7.2.330.0110.00816.80
7.2.320.0150.00716.59
7.2.310.0160.00016.53
7.2.300.0090.00916.78
7.2.290.0130.00316.76
7.2.240.0080.00815.15
7.2.230.0070.01115.09
7.2.220.0110.00315.16
7.2.210.0100.00715.01
7.2.200.0070.01115.07
7.2.190.0100.00614.86
7.2.180.0060.00915.15
7.2.170.0100.00715.15
7.2.160.0000.01415.27
7.2.150.0060.01017.01
7.2.140.0070.01017.01
7.2.130.0040.01117.11
7.2.120.0040.01417.02
7.2.110.0040.00817.05
7.2.100.0090.00616.96
7.2.90.0060.01216.96
7.2.80.0110.00616.98
7.2.70.0030.01417.13
7.2.60.0090.00616.98
7.2.50.0030.01017.02
7.2.40.0100.00716.78
7.2.30.0030.01216.82
7.2.20.0070.01116.95
7.2.10.0080.00818.44
7.2.00.0050.01118.46
7.1.330.0100.00315.73
7.1.320.0060.01015.90
7.1.310.0000.01015.67
7.1.300.0070.00715.60
7.1.290.0040.00715.74
7.1.280.0040.00815.74
7.1.270.0030.00715.59
7.1.260.0070.00715.71
7.1.250.0070.00715.56
7.1.200.0120.00315.79
7.1.130.0060.00918.67
7.1.120.0030.01018.58
7.1.110.0000.01317.73
7.1.100.0100.00318.15
7.1.90.0060.00918.01
7.1.80.0130.00318.02
7.1.70.0090.00517.17
7.1.60.0210.00735.12
7.1.50.0180.01234.49
7.1.40.0130.01334.46
7.1.30.0060.02234.60
7.1.20.0260.01034.67
7.1.10.0000.01716.70
7.1.00.0100.00316.61

preferences:
61.68 ms | 400 KiB | 5 Q