3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fruitpacks = [ ['apples', 3], ['pears', 1], ['apples', 6], ['grapes', 22], ]; abstract class ArrayTools { public static function integerAppend(array $array, $key, int $value) : array { return [$key => $value + ($array[$key] ?? 0)] + $array; } public static function integerAppendFromTuple(array $array, array $keyIntValuePair) : array { return self::integerAppend($array, ...$keyIntValuePair); } } var_dump(array_reduce($fruitpacks, [ArrayTools::class, 'integerAppendFromTuple'], []));

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.0090.00618.13
8.3.50.0070.00716.39
8.3.40.0120.00618.73
8.3.30.0060.01018.46
8.3.20.0070.00020.20
8.3.10.0050.00321.85
8.3.00.0060.00319.25
8.2.180.0150.00618.29
8.2.170.0120.00319.09
8.2.160.0100.01022.96
8.2.150.0070.00025.66
8.2.140.0030.00624.66
8.2.130.0040.00422.29
8.2.120.0040.00426.35
8.2.110.0000.00920.83
8.2.100.0080.00317.78
8.2.90.0080.00018.34
8.2.80.0060.00317.97
8.2.70.0000.00817.90
8.2.60.0060.00318.22
8.2.50.0000.00818.10
8.2.40.0050.00319.38
8.2.30.0030.00519.13
8.2.20.0040.00418.12
8.2.10.0000.00718.04
8.2.00.0030.00518.30
8.1.280.0070.00725.92
8.1.270.0080.00019.91
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00622.55
8.1.230.0080.00321.04
8.1.220.0050.00317.74
8.1.210.0050.00518.89
8.1.200.0070.00317.22
8.1.190.0050.00317.13
8.1.180.0060.00318.10
8.1.170.0080.00018.45
8.1.160.0050.00218.74
8.1.150.0050.00320.65
8.1.140.0030.00517.54
8.1.130.0030.00319.05
8.1.120.0040.00417.28
8.1.110.0060.00317.34
8.1.100.0070.00317.27
8.1.90.0000.00717.39
8.1.80.0080.00017.28
8.1.70.0030.00517.29
8.1.60.0000.00917.41
8.1.50.0110.00017.58
8.1.40.0000.00817.41
8.1.30.0040.00417.64
8.1.20.0050.00317.67
8.1.10.0000.00817.48
8.1.00.0000.01017.48
8.0.300.0040.00419.89
8.0.290.0040.00416.58
8.0.280.0070.00018.34
8.0.270.0000.00817.14
8.0.260.0030.00319.02
8.0.250.0070.00016.95
8.0.240.0030.00617.02
8.0.230.0040.00416.97
8.0.220.0000.00716.89
8.0.210.0070.00016.89
8.0.200.0060.00016.93
8.0.190.0050.00316.96
8.0.180.0040.00416.85
8.0.170.0030.01016.80
8.0.160.0040.00416.89
8.0.150.0000.00716.81
8.0.140.0060.00316.74
8.0.130.0030.00313.31
8.0.120.0040.00416.85
8.0.110.0000.00716.86
8.0.100.0040.00417.00
8.0.90.0000.00716.87
8.0.80.0040.01216.78
8.0.70.0000.00716.95
8.0.60.0030.00516.93
8.0.50.0000.00716.77
8.0.30.0110.00717.15
8.0.20.0120.00817.40
8.0.10.0070.00016.93
8.0.00.0090.00916.78
7.4.330.0050.00016.66
7.4.320.0030.00316.50
7.4.300.0050.00216.43
7.4.290.0000.00716.52
7.4.280.0000.00816.59
7.4.270.0000.00716.66
7.4.260.0000.00816.63
7.4.250.0050.00316.41
7.4.240.0030.00316.59
7.4.230.0070.00016.54
7.4.220.0050.00216.40
7.4.210.0090.00816.62
7.4.200.0040.00416.62
7.4.160.0120.00416.53
7.4.150.0130.00617.40
7.4.140.0110.00917.86
7.4.130.0090.00916.41
7.4.120.0120.01016.53
7.4.110.0130.01016.40
7.4.100.0030.01316.47
7.4.90.0100.00716.64
7.4.80.0090.00919.39
7.4.70.0030.01316.58
7.4.60.0100.00616.34
7.4.50.0060.01216.13
7.4.40.0100.00716.49
7.4.00.0100.00714.97
7.3.330.0030.00313.18
7.3.320.0020.00513.39
7.3.310.0000.00716.35
7.3.300.0030.00316.33
7.3.290.0000.00716.18
7.3.280.0070.01116.32
7.3.270.0100.00617.40
7.3.260.0100.00916.37
7.3.250.0120.00416.45
7.3.240.0140.00816.45
7.3.230.0100.00716.27
7.3.210.0110.00816.50
7.3.200.0060.01216.48
7.3.190.0090.00616.47
7.3.180.0090.00616.52
7.3.170.0080.00916.46
7.3.160.0100.01016.34
7.3.120.0070.01014.70
7.3.110.0000.01914.84
7.3.100.0100.00314.65
7.3.90.0040.01114.84
7.3.80.0070.00714.95
7.3.70.0040.00414.89
7.3.60.0070.00714.86
7.3.50.0070.01014.92
7.3.40.0110.00314.86
7.3.30.0030.01014.75
7.3.20.0060.00916.38
7.3.10.0100.00316.65
7.3.00.0000.01616.82
7.2.330.0170.00016.53
7.2.320.0060.01116.70
7.2.310.0100.00616.59
7.2.300.0080.00816.70
7.2.290.0110.00616.52
7.2.250.0070.00715.03
7.2.240.0070.01014.85
7.2.230.0070.01014.98
7.2.220.0040.01415.20
7.2.210.0070.00415.08
7.2.200.0030.01214.75
7.2.190.0000.01415.00
7.2.180.0060.00914.93
7.2.170.0070.00415.07
7.2.60.0060.00317.06
7.2.10.0070.01120.00
7.2.00.0100.00619.87
7.1.330.0070.00715.73
7.1.320.0090.00415.84
7.1.310.0070.01015.60
7.1.300.0040.00815.90
7.1.290.0100.00315.88
7.1.280.0060.00615.74
7.1.270.0040.00715.84
7.1.260.0090.00615.73
7.1.200.0000.01015.66
7.1.130.0000.02018.37
7.1.120.0060.00918.70
7.1.110.0000.01418.22
7.1.100.0080.00618.17
7.1.90.0040.01118.15
7.1.80.0160.00018.20
7.1.70.0060.00917.25
7.1.60.0250.00635.18
7.1.50.0140.01134.78
7.1.40.0120.01534.36
7.1.30.0130.01334.58
7.1.20.0200.01034.46
7.1.10.0090.00616.34
7.1.00.0000.01516.73

preferences:
58.13 ms | 400 KiB | 5 Q