3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { public $i = 1; public function foo() { return ($this->i + 1); } public function increment() { if($quantity = $this->foo() > 0) { echo $quantity . "\n"; $this->i = $quantity; } } } $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.60.0040.01118.55
8.3.50.0100.01016.47
8.3.40.0100.01318.84
8.3.30.0070.00718.71
8.3.20.0040.00418.64
8.3.10.0030.00520.48
8.3.00.0040.00417.75
8.2.180.0130.00716.50
8.2.170.0070.01122.96
8.2.160.0140.00022.13
8.2.150.0040.00424.18
8.2.140.0100.00024.66
8.2.130.0050.00226.16
8.2.120.0000.00719.89
8.2.110.0050.00520.39
8.2.100.0060.00617.91
8.2.90.0080.00019.21
8.2.80.0070.00017.97
8.2.70.0080.00017.37
8.2.60.0000.00917.92
8.2.50.0060.00318.07
8.2.40.0040.00418.28
8.2.30.0110.00017.88
8.2.20.0040.00417.66
8.2.10.0050.00317.67
8.2.00.0040.00417.68
8.1.280.0200.00725.92
8.1.270.0050.00323.99
8.1.260.0000.01026.35
8.1.250.0040.00428.09
8.1.240.0040.00422.01
8.1.230.0070.00319.20
8.1.220.0040.00418.77
8.1.210.0060.00318.97
8.1.200.0040.00417.25
8.1.190.0040.00417.41
8.1.180.0000.00818.10
8.1.170.0050.00318.66
8.1.160.0000.00718.91
8.1.150.0070.00018.68
8.1.140.0040.00417.50
8.1.130.0070.00017.82
8.1.120.0000.00717.45
8.1.110.0040.00417.49
8.1.100.0000.00817.42
8.1.90.0000.00817.32
8.1.80.0040.00417.46
8.1.70.0030.00317.36
8.1.60.0040.00417.62
8.1.50.0030.00717.52
8.1.40.0050.00517.41
8.1.30.0000.00817.57
8.1.20.0060.00317.65
8.1.10.0030.00517.46
8.1.00.0040.00417.48
8.0.300.0050.00519.88
8.0.290.0060.00316.88
8.0.280.0050.00318.46
8.0.270.0030.00317.18
8.0.260.0030.00316.77
8.0.250.0040.00417.07
8.0.240.0070.00016.89
8.0.230.0030.00317.06
8.0.220.0000.00716.95
8.0.210.0060.00017.05
8.0.200.0050.00316.99
8.0.190.0040.00417.04
8.0.180.0000.00717.01
8.0.170.0100.00016.95
8.0.160.0000.00716.89
8.0.150.0080.00016.86
8.0.140.0080.00316.98
8.0.130.0000.00613.45
8.0.120.0000.00716.98
8.0.110.0070.00016.83
8.0.100.0050.00216.86
8.0.90.0040.00416.81
8.0.80.0040.01116.94
8.0.70.0080.00016.91
8.0.60.0070.00016.86
8.0.50.0030.00516.81
8.0.30.0110.00817.06
8.0.20.0130.00517.30
8.0.10.0080.00017.07
8.0.00.0060.01716.79
7.4.330.0030.00314.73
7.4.320.0000.00616.49
7.4.300.0030.00316.63
7.4.290.0040.00416.53
7.4.280.0030.00516.50
7.4.270.0050.00316.48
7.4.260.0000.00613.28
7.4.250.0050.00316.59
7.4.240.0000.00716.54
7.4.230.0000.00716.40
7.4.220.0060.01216.67
7.4.210.0080.00816.54
7.4.200.0040.00416.51
7.4.190.0040.00416.60
7.4.160.0120.00316.58
7.4.150.0060.01017.18
7.4.140.0090.00817.18
7.4.130.0160.01916.48
7.4.120.0050.01116.54
7.4.110.0120.00616.54
7.4.100.0100.00616.44
7.4.90.0130.00316.58
7.4.80.0090.00918.80
7.4.70.0120.00616.40
7.4.60.0120.00916.38
7.4.50.0040.00416.62
7.4.40.0040.01522.27
7.4.30.0090.00616.57
7.4.00.0070.00714.85
7.3.330.0030.00513.28
7.3.320.0030.00313.23
7.3.310.0060.00016.25
7.3.300.0040.00416.17
7.3.290.0070.00716.29
7.3.280.0060.01216.24
7.3.270.0040.01317.18
7.3.260.0110.00618.24
7.3.250.0130.00616.40
7.3.240.0090.00616.39
7.3.230.0030.01616.43
7.3.210.0130.00316.25
7.3.200.0170.00419.39
7.3.190.0110.00916.38
7.3.180.0000.01916.38
7.3.170.0110.00516.39
7.3.160.0100.00716.38
7.3.120.0100.00714.83
7.2.330.0070.01016.74
7.2.320.0070.01116.58
7.2.310.0070.01016.59
7.2.300.0080.01116.54
7.2.290.0160.00016.50
7.2.60.0280.00616.50
7.2.00.0090.00319.71
7.1.200.0090.00315.77
7.1.100.0040.01118.07
7.1.70.0040.00416.77
7.1.60.0100.01419.40
7.1.50.0120.00616.80
7.1.00.0000.05722.43
7.0.200.0030.00516.81
7.0.140.0030.06321.97
7.0.60.0000.04719.79
7.0.50.0170.03017.89
7.0.40.0100.07717.69
7.0.30.0130.03317.76
7.0.20.0070.09017.79
7.0.10.0030.04317.81
7.0.00.0130.08017.83
5.6.280.0070.06720.89
5.6.210.0100.06020.52
5.6.200.0070.06018.23
5.6.190.0070.08318.12
5.6.180.0100.04018.26
5.6.170.0100.04018.14
5.6.160.0030.04318.12
5.6.150.0070.07318.18
5.6.140.0030.08718.23
5.6.130.0100.07018.15
5.6.120.0100.07718.29
5.6.110.0070.05018.14
5.6.100.0100.07718.16
5.6.90.0170.07318.21
5.6.80.0030.08317.67
5.6.70.0030.06717.58
5.6.60.0030.08017.52
5.6.50.0070.07317.66
5.6.40.0100.05717.54
5.6.30.0070.05317.54
5.6.20.0070.04017.54
5.6.10.0100.07717.64
5.6.00.0070.03717.58
5.5.350.4270.03320.45
5.5.340.0030.04717.93
5.5.330.0130.04018.08
5.5.320.0030.04017.93
5.5.310.0030.04717.98
5.5.300.0130.08017.93
5.5.290.0100.06718.08
5.5.280.0200.06718.01
5.5.270.0100.08317.93
5.5.260.0070.08718.07
5.5.250.0170.03717.88
5.5.240.0130.07317.38
5.5.230.0070.04017.36
5.5.220.0100.03317.42
5.5.210.0030.07717.43
5.5.200.0030.04317.33
5.5.190.0070.05017.33
5.5.180.0100.04017.33
5.5.160.0130.06717.30
5.5.150.0070.05317.42
5.5.140.0030.05317.28
5.5.130.0070.04017.27
5.5.120.0100.06017.40
5.5.110.0030.06017.29
5.5.100.0030.04017.18
5.5.90.0070.07017.23
5.5.80.0070.06017.33
5.5.70.0100.07317.18
5.5.60.0070.06717.19
5.5.50.0070.04717.18
5.5.40.0030.04717.18
5.5.30.0030.07017.20
5.5.20.0070.06317.18
5.5.10.0100.05017.33
5.5.00.0030.06717.19
5.4.450.0030.08019.21
5.4.440.0100.07319.28
5.4.430.0070.07719.30
5.4.420.0100.07319.30
5.4.410.0030.08319.47
5.4.400.0000.04719.02
5.4.390.0100.06719.10
5.4.380.0100.04019.04
5.4.370.0130.07019.13
5.4.360.0030.05018.99
5.4.350.0100.05319.12
5.4.340.0000.04319.10
5.4.320.0070.07719.01
5.4.310.0100.07719.12
5.4.300.0100.06019.09
5.4.290.0000.05018.96
5.4.280.0000.04319.11
5.4.270.0000.05318.95
5.4.260.0030.05019.03
5.4.250.0000.04319.04
5.4.240.0070.08319.08
5.4.230.0100.04719.03
5.4.220.0100.07319.04
5.4.210.0030.06018.94
5.4.200.0000.04718.88
5.4.190.0030.07719.13
5.4.180.0170.06019.02
5.4.170.0170.07318.85
5.4.160.0030.05719.11
5.4.150.0000.05319.02
5.4.140.0070.07316.31
5.4.130.0000.06716.55
5.4.120.0100.07016.33
5.4.110.0000.06716.57
5.4.100.0000.06716.31
5.4.90.0170.06016.49
5.4.80.0130.06716.33
5.4.70.0130.07016.34
5.4.60.0030.07316.38
5.4.50.0030.05016.39
5.4.40.0070.06716.48
5.4.30.0030.06716.45
5.4.20.0000.05016.21
5.4.10.0030.07716.37
5.4.00.0070.05015.84
5.3.290.0070.07314.63
5.3.280.0100.06714.63
5.3.270.0030.06014.66
5.3.260.0030.05714.67
5.3.250.0170.06314.71
5.3.240.0030.03714.64
5.3.230.0000.07714.81
5.3.220.0070.07014.60
5.3.210.0030.04714.57
5.3.200.0030.08314.56
5.3.190.0100.07014.67
5.3.180.0070.05314.78
5.3.170.0130.07014.64
5.3.160.0000.06714.63
5.3.150.0070.07314.54
5.3.140.0070.07314.58
5.3.130.0030.05314.79
5.3.120.0070.06314.63
5.3.110.0130.06014.52
5.3.100.0000.08014.08
5.3.90.0130.06314.23
5.3.80.0030.03714.05
5.3.70.0000.04314.01
5.3.60.0000.04014.04
5.3.50.0070.04013.94
5.3.40.0070.04013.93
5.3.30.0070.03313.94
5.3.20.0030.04013.59
5.3.10.0070.07013.71
5.3.00.0070.04713.63
5.2.170.0100.03711.00
5.2.160.0070.06011.04
5.2.150.0100.02311.00
5.2.140.0100.02311.21
5.2.130.0070.03011.18
5.2.120.0030.03711.01
5.2.110.0030.05711.00
5.2.100.0130.05311.20
5.2.90.0070.05311.13
5.2.80.0130.06011.16
5.2.70.0000.05311.06
5.2.60.0030.06311.13
5.2.50.0030.06711.10
5.2.40.0030.05011.04
5.2.30.0000.05311.19
5.2.20.0070.06311.02
5.2.10.0000.06310.71
5.2.00.0070.05710.79
5.1.60.0030.0479.94
5.1.50.0030.05310.02
5.1.40.0030.04710.03
5.1.30.0030.04710.38
5.1.20.0000.05310.56
5.1.10.0030.04310.07
5.1.00.0130.03710.12
5.0.50.0100.0378.39
5.0.40.0030.0378.47
5.0.30.0000.0538.14
5.0.20.0030.0278.14
5.0.10.0030.0278.25
5.0.00.0000.0378.14
4.4.90.0000.0378.14
4.4.80.0100.0278.14
4.4.70.0130.0078.14
4.4.60.0000.0408.14
4.4.50.0030.0338.14
4.4.40.0030.0538.14
4.4.30.0030.0278.14
4.4.20.0000.0378.14
4.4.10.0030.0378.14
4.4.00.0000.0608.14
4.3.110.0130.0238.14
4.3.100.0030.0308.14
4.3.90.0000.0238.14
4.3.80.0030.0438.14
4.3.70.0030.0278.14
4.3.60.0030.0238.14
4.3.50.0030.0338.14
4.3.40.0070.0378.14
4.3.30.0030.0278.14
4.3.20.0000.0238.14
4.3.10.0030.0338.14
4.3.00.0000.0338.14

preferences:
34.9 ms | 401 KiB | 5 Q