3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sum($a) { return new class($a) { protected $value; public function __construct($value) { $this->value = $value; } public function __invoke($a) { return new static($this->value + $a); } public function __toString() { return (string) $this->value; } }; } echo sum(1)(2)(3)(4)(5); // 15 echo sum(10)(10)(10); // 30 echo sum(-1)(-2)(3)(-3)(2)(1); // 0

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.0180.00418.54
8.3.50.0120.00921.16
8.3.40.0120.00918.72
8.3.30.0090.00618.79
8.3.20.0040.00420.38
8.3.10.0060.00321.75
8.3.00.0000.00819.79
8.2.180.0160.00618.41
8.2.170.0070.00722.96
8.2.160.0040.01520.39
8.2.150.0040.00425.66
8.2.140.0070.01124.66
8.2.130.0070.00026.16
8.2.120.0030.00617.63
8.2.110.0100.00020.38
8.2.100.0120.00017.75
8.2.90.0040.00419.23
8.2.80.0090.00017.97
8.2.70.0060.00317.63
8.2.60.0080.00018.04
8.2.50.0080.00418.07
8.2.40.0080.00021.00
8.2.30.0110.00018.14
8.2.20.0050.00217.81
8.2.10.0020.00518.00
8.2.00.0040.00418.06
8.1.280.0100.01025.92
8.1.270.0040.00420.29
8.1.260.0030.00526.35
8.1.250.0070.00028.09
8.1.240.0080.00023.77
8.1.230.0030.00917.42
8.1.220.0000.00817.74
8.1.210.0000.00918.77
8.1.200.0070.00417.35
8.1.190.0040.00417.22
8.1.180.0030.00618.10
8.1.170.0030.00618.59
8.1.160.0080.00022.07
8.1.150.0040.00418.78
8.1.140.0050.00317.46
8.1.130.0040.00417.72
8.1.120.0020.00517.36
8.1.110.0030.00617.34
8.1.100.0000.00717.56
8.1.90.0080.00017.39
8.1.80.0070.00017.38
8.1.70.0030.00317.38
8.1.60.0050.00517.48
8.1.50.0050.00317.48
8.1.40.0000.00817.50
8.1.30.0000.00817.72
8.1.20.0030.00517.64
8.1.10.0000.00717.49
8.1.00.0000.00717.42
8.0.300.0050.00218.77
8.0.290.0040.00416.63
8.0.280.0030.00318.45
8.0.270.0050.00317.28
8.0.260.0070.00017.28
8.0.250.0000.00816.98
8.0.240.0030.00617.01
8.0.230.0000.00716.91
8.0.220.0030.00316.93
8.0.210.0040.00416.78
8.0.200.0030.00316.86
8.0.190.0000.00817.04
8.0.180.0030.00816.83
8.0.170.0000.00916.95
8.0.160.0040.00416.83
8.0.150.0000.00716.78
8.0.140.0000.00816.84
8.0.130.0000.00613.36
8.0.120.0000.00816.89
8.0.110.0040.00416.93
8.0.100.0040.00416.88
8.0.90.0040.00416.87
8.0.80.0130.00716.93
8.0.70.0000.00816.74
8.0.60.0050.00316.86
8.0.50.0040.00417.02
8.0.30.0100.00917.02
8.0.20.0100.00917.40
8.0.10.0070.00016.93
8.0.00.0120.00916.91
7.4.330.0050.00015.09
7.4.320.0000.00616.55
7.4.300.0060.00016.57
7.4.290.0080.00016.66
7.4.280.0060.00516.56
7.4.270.0070.00016.52
7.4.260.0070.00016.37
7.4.250.0040.00416.57
7.4.240.0050.00316.51
7.4.230.0070.00016.43
7.4.220.0090.00916.56
7.4.210.0090.00516.50
7.4.200.0000.00716.57
7.4.160.0120.00416.58
7.4.150.0160.00317.40
7.4.140.0130.00617.86
7.4.130.0100.01016.52
7.4.120.0110.00816.50
7.4.110.0060.01216.41
7.4.100.0140.00316.47
7.4.90.0090.00916.58
7.4.80.0090.00919.39
7.4.70.0070.01316.30
7.4.60.0150.00016.35
7.4.50.0000.00816.48
7.4.40.0150.00616.68
7.4.30.0080.01416.54
7.4.00.0050.01415.02
7.3.330.0030.00313.18
7.3.320.0050.00013.27
7.3.310.0030.00316.35
7.3.300.0030.00316.25
7.3.290.0000.00716.15
7.3.280.0050.01116.28
7.3.270.0100.01017.40
7.3.260.0110.00616.37
7.3.250.0040.01316.39
7.3.240.0100.00616.43
7.3.230.0120.00816.39
7.3.210.0120.00316.41
7.3.200.0110.00816.67
7.3.190.0130.00316.31
7.3.180.0130.00316.35
7.3.170.0090.00616.37
7.3.160.0150.00716.61
7.3.120.0100.01014.73
7.3.110.0000.01415.11
7.3.100.0100.00614.93
7.3.90.0070.00714.84
7.3.80.0150.00314.81
7.3.70.0100.00314.79
7.3.60.0070.00714.99
7.3.50.0060.00914.70
7.3.40.0030.00914.75
7.3.30.0000.01714.80
7.3.20.0120.00316.52
7.3.10.0060.00716.60
7.3.00.0080.00516.64
7.2.330.0070.01016.66
7.2.320.0130.00916.57
7.2.310.0120.00616.86
7.2.300.0170.00016.47
7.2.290.0090.00916.54
7.2.250.0120.00915.03
7.2.240.0190.00315.04
7.2.230.0100.00615.10
7.2.220.0000.01414.91
7.2.210.0120.00615.08
7.2.200.0060.00615.11
7.2.190.0120.00615.20
7.2.180.0060.00914.85
7.2.170.0070.00615.18
7.2.130.0080.00716.75
7.2.120.0020.01116.80
7.2.110.0080.00616.59
7.2.100.0080.00716.65
7.2.90.0100.00316.86
7.2.80.0100.00516.78
7.2.70.0080.00816.78
7.2.60.0050.01016.92
7.2.50.0030.01416.85
7.2.40.0080.00416.72
7.2.30.0060.00516.63
7.2.20.0040.01016.83
7.2.10.0080.00616.82
7.2.00.0030.00917.67
7.1.330.0030.01215.88
7.1.320.0110.00415.65
7.1.310.0090.00615.63
7.1.300.0140.00315.81
7.1.290.0030.01015.80
7.1.280.0030.01015.70
7.1.270.0040.01115.81
7.1.260.0030.01015.81
7.1.250.0060.00415.71
7.1.200.0070.00315.70
7.1.100.0100.00717.60
7.1.70.0040.00417.03
7.1.60.0100.00620.03
7.1.50.0100.01016.80
7.1.00.0070.07322.43
7.0.200.0120.00316.88
7.0.60.0130.07719.92
7.0.50.0070.07317.83
7.0.40.0070.04720.40
7.0.30.0270.05320.25
7.0.20.0270.04720.09
7.0.10.0130.05020.24
7.0.00.0030.04320.23
5.6.280.0030.06320.91
5.6.210.0070.08020.73
5.6.200.0070.08018.19
5.6.190.0070.08320.50
5.6.180.0330.07020.62
5.6.170.0230.05720.54
5.6.160.0030.05020.54
5.6.150.0030.08318.18
5.6.140.0030.06718.11
5.6.130.0100.07318.18
5.6.120.0100.05021.02
5.6.110.0200.06721.01
5.6.100.0030.08021.04
5.6.90.0030.04720.98
5.6.80.0100.07720.51
5.5.350.0000.08020.53
5.5.340.0070.04718.09
5.5.330.0030.06320.47
5.5.320.3700.04720.29
5.5.310.0270.04720.34
5.5.300.0030.07018.07
5.5.290.0000.06017.98
5.5.280.0030.08020.77
5.5.270.0030.04320.75
5.5.260.0030.08720.85
5.5.250.0100.08020.46
5.5.240.0000.04020.19
5.4.450.0400.06319.66
5.4.440.0500.05719.46
5.4.430.0500.05319.57
5.4.420.0530.05319.57
5.4.410.0600.04019.32
5.4.400.0600.04319.14
5.4.390.0500.05319.27
5.4.380.0670.04018.97
5.4.370.0530.05318.86
5.4.360.0570.04318.83
5.4.350.0530.05318.86
5.4.340.0500.05318.99
5.4.320.0470.05319.13
5.4.310.0570.04319.23
5.4.300.0500.05019.13
5.4.290.0500.05018.86
5.4.280.0570.04719.19
5.4.270.0530.05019.04
5.4.260.0570.04719.26
5.4.250.0530.04719.24
5.4.240.0430.05719.11
5.4.230.0430.06019.21
5.4.220.0530.05018.85
5.4.210.0670.06319.27
5.4.200.0570.05316.79
5.4.190.0500.05019.11
5.4.180.0470.05319.14
5.4.170.0600.06019.02
5.4.160.0600.04018.89
5.4.150.0470.05318.98
5.4.140.0570.04316.55
5.4.130.0630.04316.51
5.4.120.0500.05016.75
5.4.110.0470.05016.73
5.4.100.0530.04316.43
5.4.90.0570.04016.57
5.4.80.0530.04316.29
5.4.70.0430.05316.29
5.4.60.0430.05016.32
5.4.50.0530.05016.48
5.4.40.0630.04716.47
5.4.30.0570.05016.50
5.4.20.0530.05316.27
5.4.10.0470.05316.54
5.4.00.0530.04316.01

preferences:
58.59 ms | 401 KiB | 5 Q