3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { public $i = 1; public function foo($num) { return ($num + 1); } public function increment() { if($quantity = $this->foo($this->i) > 0) { echo $quantity; echo $this->i = ($quantity + 1); } } } $test = new a(); $test->increment(); $test->increment();

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.40.0110.00718.83
8.3.30.0150.00020.16
8.3.20.0050.00320.25
8.3.10.0040.00422.10
8.3.00.0040.00422.34
8.2.170.0080.00622.96
8.2.160.0110.00420.39
8.2.150.0000.00824.18
8.2.140.0140.00724.66
8.2.130.0060.01026.16
8.2.120.0040.00419.66
8.2.110.0000.01020.47
8.2.100.0060.00618.03
8.2.90.0000.00819.27
8.2.80.0000.00817.97
8.2.70.0040.00417.61
8.2.60.0080.00017.93
8.2.50.0060.00318.07
8.2.40.0050.00218.28
8.2.30.0040.00418.02
8.2.20.0050.00317.62
8.2.10.0080.00017.63
8.2.00.0000.00717.71
8.1.270.0080.00024.66
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0110.00022.11
8.1.230.0120.00017.58
8.1.220.0060.00317.74
8.1.210.0050.00318.77
8.1.200.0030.00617.48
8.1.190.0080.00017.54
8.1.180.0020.00520.20
8.1.170.0070.00518.14
8.1.160.0050.00322.21
8.1.150.0000.00718.64
8.1.140.0030.00617.36
8.1.130.0000.00717.79
8.1.120.0000.00817.44
8.1.110.0050.00317.35
8.1.100.0000.00817.36
8.1.90.0000.00717.38
8.1.80.0040.00317.43
8.1.70.0030.00317.37
8.1.60.0000.00817.41
8.1.50.0040.00417.54
8.1.40.0050.00317.37
8.1.30.0000.00817.63
8.1.20.0040.00417.57
8.1.10.0070.00017.48
8.1.00.0070.00017.54
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0000.00718.45
8.0.270.0000.00817.27
8.0.260.0030.00316.79
8.0.250.0000.00717.02
8.0.240.0040.00416.95
8.0.230.0000.00716.97
8.0.220.0030.00516.93
8.0.210.0000.00717.01
8.0.200.0030.00316.88
8.0.190.0030.00317.04
8.0.180.0070.00016.86
8.0.170.0040.00416.94
8.0.160.0030.00316.83
8.0.150.0040.00416.86
8.0.140.0040.00416.86
8.0.130.0060.00013.48
8.0.120.0050.00316.91
8.0.110.0040.00416.92
8.0.100.0040.00416.83
8.0.90.0040.00417.02
8.0.80.0120.00316.92
8.0.70.0040.00417.00
8.0.60.0050.00216.91
8.0.50.0000.00716.91
8.0.30.0120.00717.14
8.0.20.0110.00817.40
8.0.10.0040.00417.19
8.0.00.0070.01316.76
7.4.330.0000.00515.00
7.4.320.0070.00016.42
7.4.300.0000.00616.60
7.4.290.0000.00716.61
7.4.280.0030.00316.43
7.4.270.0040.00416.52
7.4.260.0030.00516.59
7.4.250.0030.00516.57
7.4.240.0030.00416.52
7.4.230.0070.00016.63
7.4.220.0060.01216.69
7.4.210.0080.00716.62
7.4.200.0070.00016.45
7.4.190.0080.00016.39
7.4.160.0060.01016.50
7.4.150.0120.00617.40
7.4.140.0100.00717.86
7.4.130.0130.01616.50
7.4.120.0120.00816.63
7.4.110.0130.00416.65
7.4.100.0140.00716.54
7.4.90.0080.00816.46
7.4.80.0090.00919.39
7.4.70.0070.01116.64
7.4.60.0100.00716.49
7.4.50.0000.00816.45
7.4.40.0000.01522.77
7.4.30.0090.01216.73
7.4.00.0000.01114.63
7.3.330.0050.00013.17
7.3.320.0060.00013.29
7.3.310.0050.00316.17
7.3.300.0000.00716.18
7.3.290.0100.00416.37
7.3.280.0110.00416.32
7.3.270.0100.00717.40
7.3.260.0070.01016.36
7.3.250.0090.01016.61
7.3.240.0120.00416.42
7.3.230.0090.01516.39
7.3.210.0030.01316.46
7.3.200.0110.00719.39
7.3.190.0100.01016.37
7.3.180.0130.00316.38
7.3.170.0030.01216.38
7.3.160.0130.00616.53
7.3.120.0040.01115.08
7.2.330.0120.00616.44
7.2.320.0030.01716.68
7.2.310.0130.00316.39
7.2.300.0130.00316.80
7.2.290.0030.01316.65
7.2.00.0030.01219.43
7.1.100.0030.00917.90
7.1.70.0000.00717.15
7.1.60.0070.01819.29
7.1.50.0130.00716.99
7.1.00.0000.04322.57
7.0.200.0660.00914.73
7.0.140.0100.07022.21
7.0.60.0070.07019.91
7.0.50.0070.08017.98
7.0.40.0030.07320.24
7.0.30.0300.07320.09
7.0.20.0270.05320.15
7.0.10.0200.07320.23
7.0.00.0070.05320.14
5.6.280.0070.07021.13
5.6.210.0070.08020.49
5.6.200.0070.08018.27
5.6.190.0030.04720.56
5.6.180.0230.05320.63
5.6.170.0200.08020.49
5.6.160.0070.06020.52
5.6.150.0030.07318.18
5.6.140.0070.04018.14
5.6.130.0000.05018.13
5.6.120.0130.08321.10
5.6.110.0000.04320.90
5.6.100.0070.05020.97
5.6.90.0070.07720.98
5.6.80.0030.05020.42
5.6.70.0230.07720.33
5.5.350.0200.07020.48
5.5.340.0100.07717.95
5.5.330.0070.08720.34
5.5.320.0200.03320.32
5.5.310.0230.07320.41
5.5.300.0070.04317.94
5.5.290.0100.08318.08
5.5.280.0070.08320.77
5.5.270.0100.04020.90
5.5.260.0030.08320.98
5.5.250.0130.07720.61
5.5.240.0030.07020.27
5.4.450.0070.06719.64
5.4.440.0700.06019.59
5.4.430.0630.05719.58
5.4.420.0530.05719.57
5.4.410.0900.04719.34
5.4.400.0400.05318.75
5.4.390.0370.07018.41
5.4.380.0070.07018.73
5.4.370.0200.04718.69
5.4.360.0170.04718.46
5.4.350.0090.03212.02
5.4.340.0090.04412.02
5.4.320.0050.03712.51
5.4.310.0050.04012.50
5.4.300.0080.03912.50
5.4.290.0070.03712.50
5.4.280.0090.03312.40
5.4.270.0050.04012.40
5.4.260.0050.03812.39
5.4.250.0100.04718.93
5.4.240.0170.04718.93
5.4.230.0100.04718.80
5.4.220.0030.05718.90
5.4.210.0030.05718.97
5.4.200.0070.05318.99
5.4.190.0030.05319.05
5.4.180.0000.06318.98
5.4.170.0070.06019.05
5.4.160.0000.05718.92
5.4.150.0070.05318.91
5.4.140.0100.04716.49
5.4.130.0130.05316.59
5.4.120.0030.05316.31
5.4.110.0130.04316.45
5.4.100.0030.05016.44
5.4.90.0130.03716.48
5.4.80.0130.04016.32
5.4.70.0100.04316.34
5.4.60.0070.05716.43
5.4.50.0000.07316.54
5.4.40.0100.04716.41
5.4.30.0030.05016.35
5.4.20.0000.05316.43
5.4.10.0070.05016.41
5.4.00.0030.05316.00
5.3.290.0090.04012.80
5.3.280.0100.04714.68
5.3.270.0030.05714.44
5.3.260.0130.05014.61
5.3.250.0130.04714.79
5.3.240.0130.04714.44
5.3.230.0070.05014.78
5.3.220.0070.05014.59
5.3.210.0230.04014.65
5.3.200.0000.05714.57
5.3.190.0030.05314.64
5.3.180.0030.05014.57
5.3.170.0100.04314.79
5.3.160.0100.04314.48
5.3.150.0100.04714.65
5.3.140.0070.04714.72
5.3.130.0100.05314.54
5.3.120.0200.06314.73
5.3.110.0030.05314.77
5.3.100.0070.04714.02
5.3.90.0070.04714.01
5.3.80.0070.04714.09
5.3.70.0030.05013.92
5.3.60.0000.05314.22
5.3.50.0100.04713.95
5.3.40.0100.06713.97
5.3.30.0000.05314.00
5.3.20.0030.05013.80
5.3.10.0100.04013.67
5.3.00.0100.04313.71
5.2.170.0070.03711.12
5.2.160.0100.03311.13
5.2.150.0070.04011.22
5.2.140.0000.04711.23
5.2.130.0000.04311.07
5.2.120.0030.03711.09
5.2.110.0030.04011.18
5.2.100.0100.03311.27
5.2.90.0070.05011.19
5.2.80.0000.04311.00
5.2.70.0030.04011.05
5.2.60.0000.04711.21
5.2.50.0030.04311.20
5.2.40.0030.04011.17
5.2.30.0000.06311.05
5.2.20.0030.03711.04
5.2.10.0030.04010.82
5.2.00.0000.04010.63
5.1.60.0030.03310.06
5.1.50.0070.0309.84
5.1.40.0030.05010.07
5.1.30.0000.03710.25
5.1.20.0000.05010.44
5.1.10.0070.0339.99
5.1.00.0100.03010.12
5.0.50.0000.0308.64
5.0.40.0030.0278.64
5.0.30.0000.0438.20
5.0.20.0030.0278.11
5.0.10.0030.0278.09
5.0.00.0030.0408.13
4.4.90.0030.0207.39
4.4.80.0070.0177.39
4.4.70.0030.0207.39
4.4.60.0000.0237.39
4.4.50.0000.0237.39
4.4.40.0000.0377.39
4.4.30.0030.0177.39
4.4.20.0070.0177.39
4.4.10.0070.0177.39
4.4.00.0030.0307.39
4.3.110.0100.0177.39
4.3.100.0000.0237.39
4.3.90.0130.0207.39
4.3.80.0000.0337.39
4.3.70.0070.0137.39
4.3.60.0070.0177.39
4.3.50.0030.0207.39
4.3.40.0000.0337.39
4.3.30.0030.0207.39
4.3.20.0000.0237.39
4.3.10.0070.0177.39
4.3.00.0100.0236.85

preferences:
37.94 ms | 400 KiB | 5 Q