3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sum = function ($a, $b) { return $a + $b; }; function calc($value_or_function, array $buffer = []) { if (is_callable($value_or_function)) { if (count($buffer) === 0) { throw new \InvalidArgumentException('Not enough parameters.'); } return array_reduce(array_slice($buffer, 1), $value_or_function, $buffer[0]); } return static function ($otherValue) use ($buffer, $value_or_function) { return calc($otherValue, array_merge($buffer, [$value_or_function])); }; } echo calc(5)(4)(3)($sum), PHP_EOL; echo calc(5)(2)(2)('pow');

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.00620.01
8.4.150.0010.00014.05
8.4.140.0080.01217.59
8.4.130.0070.00317.58
8.4.120.0140.00623.89
8.4.110.0130.00618.70
8.4.100.0140.00617.86
8.4.90.0130.00818.61
8.4.80.0040.00717.73
8.4.70.0130.00917.97
8.4.60.0110.01018.72
8.4.50.0060.00220.64
8.4.40.0030.01319.49
8.4.30.0130.00322.18
8.4.20.0000.00818.68
8.4.10.0030.01322.20
8.3.280.0100.00820.68
8.3.270.0140.00716.73
8.3.260.0140.00516.43
8.3.250.0100.00216.44
8.3.240.0130.00616.96
8.3.230.0070.00216.72
8.3.220.0090.00818.95
8.3.210.0150.00716.38
8.3.200.0060.00316.73
8.3.190.0120.00717.22
8.3.180.0120.00818.91
8.3.170.0070.01320.88
8.3.160.0060.01317.11
8.3.150.0090.00917.18
8.3.140.0000.01916.60
8.3.130.0070.01416.38
8.3.120.0110.00420.69
8.3.110.0000.01016.47
8.3.100.0030.00616.36
8.3.90.0080.00018.27
8.3.80.0060.00316.63
8.3.70.0090.00616.63
8.3.60.0080.00818.43
8.3.50.0090.00418.40
8.3.40.0070.00718.63
8.3.30.0060.00918.45
8.3.20.0070.00021.80
8.3.10.0070.00022.02
8.3.00.0050.00322.30
8.2.290.0130.00620.45
8.2.280.0120.00818.56
8.2.270.0140.00418.79
8.2.260.0090.00916.70
8.2.250.0060.00316.71
8.2.240.0040.00419.01
8.2.230.0140.00320.94
8.2.220.0070.00724.06
8.2.210.0070.00726.77
8.2.200.0070.00316.50
8.2.190.0110.00416.63
8.2.180.0060.01025.92
8.2.170.0070.00718.91
8.2.160.0100.00322.96
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00426.16
8.2.110.0070.00319.32
8.2.100.0060.00617.91
8.2.90.0000.00818.03
8.2.80.0050.00318.04
8.2.70.0040.00417.93
8.2.60.0050.00318.15
8.2.50.0040.00418.10
8.2.40.0000.00821.14
8.2.30.0030.00619.24
8.2.20.0040.00418.13
8.2.10.0050.00218.79
8.2.00.0030.00519.38
8.1.330.0130.00622.12
8.1.320.0140.00516.19
8.1.310.0100.00716.64
8.1.300.0110.00718.57
8.1.290.0060.00330.84
8.1.280.0120.00625.92
8.1.270.0040.00422.52
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0040.00423.83
8.1.230.0030.00820.86
8.1.220.0030.00517.76
8.1.210.0060.00320.67
8.1.200.0080.00017.22
8.1.190.0060.00317.36
8.1.180.0030.00518.10
8.1.170.0050.00318.61
8.1.160.0030.00318.96
8.1.150.0020.00518.81
8.1.140.0000.00818.81
8.1.130.0040.00417.44
8.1.120.0040.00417.46
8.1.110.0030.00617.50
8.1.100.0070.00017.38
8.1.90.0090.00017.43
8.1.80.0050.00317.50
8.1.70.0000.00817.36
8.1.60.0060.00317.49
8.1.50.0030.00517.57
8.1.40.0080.00017.44
8.1.30.0030.00817.54
8.1.20.0000.00917.64
8.1.10.0000.00717.47
8.1.00.0000.00717.48
8.0.300.0000.00719.86
8.0.290.0070.00016.63
8.0.280.0040.00418.31
8.0.270.0050.00317.29
8.0.260.0030.00316.77
8.0.250.0030.00316.85
8.0.240.0000.00616.92
8.0.230.0070.00016.99
8.0.220.0000.00716.91
8.0.210.0080.00016.84
8.0.200.0030.00316.84
8.0.190.0040.00416.88
8.0.180.0070.00016.79
8.0.170.0000.00816.79
8.0.160.0040.00416.86
8.0.150.0040.00416.71
8.0.140.0000.00816.84
8.0.130.0000.00613.30
8.0.120.0000.00816.75
8.0.110.0000.00716.77
8.0.100.0000.00716.70
8.0.90.0040.00416.71
8.0.80.0070.01016.83
8.0.70.0030.00716.94
8.0.60.0030.00516.95
8.0.50.0040.00416.88
8.0.30.0070.01317.06
8.0.20.0300.03017.23
8.0.10.0020.00516.80
8.0.00.0160.00616.67
7.4.330.0000.00515.55
7.4.320.0030.00316.50
7.4.300.0000.00616.41
7.4.290.0060.00316.58
7.4.280.0040.00416.59
7.4.270.0070.00016.60
7.4.260.0060.00013.27
7.4.250.0030.00316.56
7.4.240.0040.00416.50
7.4.230.0030.00516.66
7.4.220.0030.00316.46
7.4.210.0110.00616.53
7.4.200.0000.00716.34
7.4.140.0070.01017.86
7.4.130.0110.00616.47
7.4.120.0050.01516.45
7.4.110.0090.00916.68
7.4.100.0060.01316.47
7.4.90.0150.00616.30
7.4.80.0160.00619.39
7.4.70.0140.00316.44
7.4.60.0120.00616.44
7.4.50.0070.01016.25
7.4.40.0030.01216.48
7.4.00.0030.00914.93
7.3.330.0030.00316.25
7.3.320.0020.00213.26
7.3.310.0000.00716.44
7.3.300.0070.00016.32
7.3.290.0020.00516.15
7.3.260.0110.00916.44
7.3.240.0090.00816.37
7.3.230.0060.00916.46
7.3.210.0160.00616.39
7.3.200.0100.01416.53
7.3.190.0100.00716.41
7.3.180.0120.00316.39
7.3.170.0030.01316.27
7.3.160.0060.01016.66
7.3.110.0030.01014.98
7.3.100.0060.00914.83
7.3.90.0070.00714.50
7.3.80.0070.00715.09
7.3.70.0110.00414.68
7.3.60.0040.01114.91
7.3.50.0150.00314.59
7.3.40.0130.00714.83
7.3.30.0110.00314.93
7.3.20.0100.00414.91
7.3.10.0040.01114.75
7.3.00.0100.00614.90
7.2.330.0060.01216.82
7.2.320.0060.01316.79
7.2.310.0060.01216.66
7.2.300.0110.01116.60
7.2.290.0030.01316.78
7.2.240.0050.00815.02
7.2.230.0000.01514.96
7.2.220.0000.01415.13
7.2.210.0080.00514.92
7.2.200.0120.00314.84
7.2.190.0070.01314.84
7.2.180.0080.01214.75
7.2.170.0080.00615.09
7.2.160.0130.00314.91
7.2.150.0260.00314.99
7.2.140.0080.00715.06
7.2.130.0090.00614.87
7.2.120.0120.01015.09
7.2.110.0140.00314.97
7.2.100.0160.00615.15
7.2.90.0100.01315.24
7.2.80.0090.00614.99
7.2.70.0030.01315.07
7.2.60.0090.01215.16
7.2.50.0030.01315.13
7.2.40.0060.01114.87
7.2.30.0100.00715.14
7.2.20.0060.01015.31
7.2.10.0190.00315.04
7.2.00.0120.00315.17
7.1.330.0030.01013.98
7.1.320.0030.01014.05
7.1.310.0070.00713.95
7.1.300.0040.01313.75
7.1.290.0000.01913.76
7.1.280.0110.00813.91
7.1.270.0030.01014.03
7.1.260.0000.01514.02
7.1.250.0100.01014.09

preferences:
45.24 ms | 403 KiB | 5 Q