3v4l.org

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

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.0070.01118.68
8.3.50.0110.00721.06
8.3.40.0140.00018.70
8.3.30.0040.01118.71
8.3.20.0000.00820.29
8.3.10.0070.00021.86
8.3.00.0030.00519.79
8.2.180.0110.00418.41
8.2.170.0120.00622.96
8.2.160.0030.01322.07
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0060.00317.63
8.2.110.0030.00720.98
8.2.100.0110.00017.63
8.2.90.0060.00619.08
8.2.80.0040.00717.97
8.2.70.0060.00317.63
8.2.60.0000.00718.05
8.2.50.0090.00018.07
8.2.40.0050.00321.18
8.2.30.0040.00419.72
8.2.20.0040.00417.80
8.2.10.0050.00217.92
8.2.00.0050.00217.95
8.1.280.0090.00625.92
8.1.270.0090.00020.25
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0030.00622.47
8.1.230.0070.00420.89
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0040.00417.23
8.1.190.0000.00817.23
8.1.180.0040.00418.10
8.1.170.0030.00618.56
8.1.160.0000.00721.89
8.1.150.0000.00718.72
8.1.140.0000.00917.36
8.1.130.0030.00317.77
8.1.120.0080.00017.37
8.1.110.0050.00317.41
8.1.100.0030.00317.38
8.1.90.0000.00717.49
8.1.80.0040.00417.41
8.1.70.0030.00317.36
8.1.60.0000.00817.61
8.1.50.0040.00417.50
8.1.40.0050.00317.55
8.1.30.0040.00417.52
8.1.20.0030.00517.71
8.1.10.0000.00717.55
8.1.00.0040.00417.54
8.0.300.0070.00018.77
8.0.290.0060.00316.63
8.0.280.0000.00818.52
8.0.270.0030.00317.33
8.0.260.0000.00617.16
8.0.250.0000.00817.00
8.0.240.0030.00616.97
8.0.230.0000.00716.92
8.0.220.0000.00816.80
8.0.210.0040.00416.95
8.0.200.0000.00616.98
8.0.190.0060.00316.98
8.0.180.0030.00616.82
8.0.170.0000.00816.96
8.0.160.0000.00816.91
8.0.150.0000.00716.82
8.0.140.0030.00416.71
8.0.130.0000.00613.36
8.0.120.0050.00316.80
8.0.110.0000.00716.88
8.0.100.0000.00716.84
8.0.90.0000.00716.79
8.0.80.0070.01316.86
8.0.70.0040.00416.87
8.0.60.0040.00416.87
8.0.50.0070.00016.97
8.0.30.0070.01017.21
8.0.20.0100.00717.40
8.0.10.0000.00716.94
8.0.00.0100.00916.74
7.4.330.0000.00515.08
7.4.320.0000.00816.45
7.4.300.0030.00316.57
7.4.290.0000.00716.45
7.4.280.0040.00416.47
7.4.270.0060.00016.51
7.4.260.0050.00216.64
7.4.250.0090.00216.47
7.4.240.0030.00416.54
7.4.230.0040.00416.64
7.4.220.0120.00816.48
7.4.210.0070.00716.67
7.4.200.0050.00316.70
7.4.160.0030.01316.45
7.4.150.0030.01417.40
7.4.140.0110.00817.86
7.4.130.0130.00716.45
7.4.120.0110.00716.50
7.4.110.0220.00016.59
7.4.100.0110.00616.50
7.4.90.0060.01216.57
7.4.80.0130.00619.39
7.4.70.0100.00716.22
7.4.60.0090.00616.39
7.4.50.0090.00016.39
7.4.40.0030.01316.61
7.4.30.0150.00416.56
7.4.00.0060.00914.91
7.3.330.0030.00313.33
7.3.320.0030.00313.23
7.3.310.0030.00316.29
7.3.300.0060.00016.24
7.3.290.0040.00416.36
7.3.280.0110.00716.33
7.3.270.0060.01817.40
7.3.260.0090.00916.62
7.3.250.0120.01016.47
7.3.240.0100.00716.34
7.3.230.0070.01016.39
7.3.210.0070.01116.42
7.3.200.0110.01116.65
7.3.190.0060.01016.37
7.3.180.0150.00916.48
7.3.170.0080.00816.49
7.3.160.0140.00816.32
7.3.120.0090.00914.88
7.3.110.0030.01515.04
7.3.100.0040.00815.05
7.3.90.0030.01014.87
7.3.80.0040.01114.84
7.3.70.0070.00714.72
7.3.60.0100.00014.96
7.3.50.0110.00414.68
7.3.40.0060.00315.00
7.3.30.0080.00414.79
7.3.20.0130.00316.66
7.3.10.0070.00716.62
7.3.00.0120.00316.72
7.2.330.0060.01216.71
7.2.320.0070.01516.69
7.2.310.0070.01516.63
7.2.300.0100.00616.55
7.2.290.0030.01516.59
7.2.250.0030.01715.23
7.2.240.0060.00915.17
7.2.230.0100.00714.91
7.2.220.0030.00815.14
7.2.210.0070.00714.96
7.2.200.0000.01414.94
7.2.190.0070.00715.05
7.2.180.0120.00314.97
7.2.170.0070.00714.73
7.2.60.0060.00916.85
7.2.00.0000.01619.46
7.1.330.0030.00815.69
7.1.320.0040.00415.79
7.1.310.0060.00315.86
7.1.300.0040.00715.83
7.1.290.0100.00315.71
7.1.280.0060.00315.97
7.1.270.0100.00315.60
7.1.260.0060.00315.73
7.1.200.0000.01215.57
7.1.100.0090.00318.15
7.1.70.0040.00416.81
7.1.60.0170.00720.03
7.1.50.0100.01416.80
7.1.00.0000.08022.31
7.0.200.0900.01016.52
7.0.60.0030.08319.95
7.0.50.0270.03717.82
7.0.40.0030.09320.04
7.0.30.0500.07320.08
7.0.20.0370.06720.10
7.0.10.0070.08020.21
7.0.00.0070.04320.19
5.6.280.0000.05021.16
5.6.210.0100.07720.66
5.6.200.0100.08018.20
5.6.190.0130.07720.48
5.6.180.0070.05020.48
5.6.170.0300.07320.61
5.6.160.0100.04720.55
5.6.150.0030.05718.15
5.6.140.0030.04018.24
5.6.130.0030.06318.13
5.6.120.0170.07321.02
5.6.110.0070.08721.07
5.6.100.0100.07320.99
5.6.90.0100.04721.01
5.6.80.0070.04020.41
5.5.350.0030.07020.44
5.5.340.0100.07717.93
5.5.330.0130.08320.27
5.5.320.0030.05020.29
5.5.310.0270.07720.22
5.5.300.0030.05717.96
5.5.290.0070.08017.93
5.5.280.0100.08320.88
5.5.270.0000.04320.89
5.5.260.0100.07720.73
5.5.250.0030.08320.55
5.5.240.0100.08020.37
5.4.450.0530.06719.37
5.4.440.0600.06319.58
5.4.430.0600.05719.30
5.4.420.0630.06319.67
5.4.410.0730.04719.49
5.4.400.0630.05718.88
5.4.390.0600.06719.23
5.4.380.0670.07019.23
5.4.370.0530.05019.26
5.4.360.0700.07318.87
5.4.350.0730.05719.15
5.4.340.0600.06019.04
5.4.320.0630.05019.04
5.4.310.0630.05319.12
5.4.300.0570.04719.14
5.4.290.0630.06019.25
5.4.280.0700.06019.14
5.4.270.0770.05319.29
5.4.260.0830.06318.87
5.4.250.0700.04718.86
5.4.240.0670.04319.16
5.4.230.0670.07018.83
5.4.220.0800.05718.83
5.4.210.0670.07319.09
5.4.200.0600.06716.80
5.4.190.0630.05319.13
5.4.180.0670.04719.01
5.4.170.0530.06319.33
5.4.160.0570.06019.25
5.4.150.0530.05319.25
5.4.140.0500.05016.59
5.4.130.0500.05316.46
5.4.120.0600.07016.48
5.4.110.0670.04316.50
5.4.100.0630.06016.58
5.4.90.0800.05316.46
5.4.80.0570.05016.54
5.4.70.0670.04316.54
5.4.60.0530.06316.28
5.4.50.0570.03716.50
5.4.40.0430.05716.30
5.4.30.0430.05716.53
5.4.20.0530.03716.36
5.4.10.0570.04016.40
5.4.00.0570.06015.96

preferences:
56.83 ms | 401 KiB | 5 Q