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 $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.60.0100.01018.43
8.3.50.0070.00721.33
8.3.40.0000.01418.76
8.3.30.0140.01020.34
8.3.20.0040.00420.35
8.3.10.0060.00321.92
8.3.00.0070.00022.34
8.2.180.0130.00318.33
8.2.170.0040.01222.96
8.2.160.0100.00320.35
8.2.150.0050.00324.18
8.2.140.0100.01024.66
8.2.130.0140.00326.16
8.2.120.0000.00819.42
8.2.110.0040.00819.19
8.2.100.0060.00617.63
8.2.90.0040.00419.05
8.2.80.0040.00417.97
8.2.70.0050.00317.63
8.2.60.0060.00618.05
8.2.50.0060.00318.07
8.2.40.0040.00419.88
8.2.30.0040.00418.05
8.2.20.0040.00417.72
8.2.10.0000.00817.77
8.2.00.0000.00717.59
8.1.280.0120.00325.92
8.1.270.0030.00524.66
8.1.260.0030.00526.35
8.1.250.0040.00428.09
8.1.240.0070.00323.88
8.1.230.0090.00317.66
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0040.00417.35
8.1.190.0050.00317.36
8.1.180.0000.00818.10
8.1.170.0000.00820.35
8.1.160.0040.00422.02
8.1.150.0060.00318.63
8.1.140.0000.00717.37
8.1.130.0000.00717.83
8.1.120.0000.01017.52
8.1.110.0030.00617.42
8.1.100.0000.00717.45
8.1.90.0070.00017.48
8.1.80.0000.00717.47
8.1.70.0070.00017.49
8.1.60.0000.00817.54
8.1.50.0070.00017.43
8.1.40.0050.00217.43
8.1.30.0080.00017.64
8.1.20.0000.00817.64
8.1.10.0050.00217.61
8.1.00.0020.00517.51
8.0.300.0030.00618.77
8.0.290.0000.00716.88
8.0.280.0030.00318.32
8.0.270.0070.00017.14
8.0.260.0030.00316.90
8.0.250.0030.00516.98
8.0.240.0080.00017.04
8.0.230.0040.00416.91
8.0.220.0030.00516.90
8.0.210.0000.00816.98
8.0.200.0030.00316.91
8.0.190.0000.00716.94
8.0.180.0070.00016.94
8.0.170.0000.00716.84
8.0.160.0040.00416.98
8.0.150.0040.00416.86
8.0.140.0050.00316.80
8.0.130.0030.00313.43
8.0.120.0040.00417.00
8.0.110.0020.00516.95
8.0.100.0080.00016.99
8.0.90.0000.00716.85
8.0.80.0030.01216.88
8.0.70.0030.00517.00
8.0.60.0080.00016.95
8.0.50.0000.00717.01
8.0.30.0130.00617.22
8.0.20.0090.00917.40
8.0.10.0040.00416.98
8.0.00.0100.00916.88
7.4.330.0000.00515.00
7.4.320.0000.00616.52
7.4.300.0050.00216.65
7.4.290.0070.00016.60
7.4.280.0000.00716.46
7.4.270.0070.00016.61
7.4.260.0040.00416.61
7.4.250.0050.00216.58
7.4.240.0050.00216.48
7.4.230.0040.00416.72
7.4.220.0120.00616.43
7.4.210.0080.00716.58
7.4.200.0000.00716.68
7.4.190.0000.00816.68
7.4.160.0090.00616.48
7.4.150.0120.00917.40
7.4.140.0120.00617.86
7.4.130.0080.01016.60
7.4.120.0120.00516.49
7.4.110.0090.00816.46
7.4.100.0070.01116.52
7.4.90.0170.00716.54
7.4.80.0080.00919.39
7.4.70.0090.01216.64
7.4.60.0050.01216.38
7.4.50.0080.00016.50
7.4.40.0100.00622.77
7.4.30.0140.00616.65
7.4.00.0080.00714.96
7.3.330.0030.00413.16
7.3.320.0000.00613.25
7.3.310.0080.00016.34
7.3.300.0070.00016.31
7.3.290.0140.00016.25
7.3.280.0090.00616.32
7.3.270.0060.01217.40
7.3.260.0160.00816.39
7.3.250.0150.00416.56
7.3.240.0120.00416.24
7.3.230.0080.00816.39
7.3.210.0140.00416.30
7.3.200.0150.00416.62
7.3.190.0070.01016.71
7.3.180.0170.00516.28
7.3.170.0090.00916.43
7.3.160.0100.00716.48
7.3.120.0100.00714.71
7.3.10.0030.01216.61
7.3.00.0070.01016.36
7.2.330.0110.01116.71
7.2.320.0070.01416.82
7.2.310.0100.01016.58
7.2.300.0100.00616.42
7.2.290.0130.01316.55
7.2.130.0100.00716.95
7.2.120.0070.01016.73
7.2.110.0100.00316.83
7.2.100.0070.00717.00
7.2.90.0040.01117.09
7.2.80.0060.00616.79
7.2.70.0040.00816.59
7.2.60.0070.00416.79
7.2.50.0100.00616.85
7.2.40.0110.01116.86
7.2.30.0040.01416.95
7.2.20.0170.00016.99
7.2.10.0100.00716.52
7.2.00.0090.00718.20
7.1.250.0080.00815.48
7.1.240.0110.00315.79
7.1.230.0060.00615.75
7.1.220.0120.00315.66
7.1.210.0130.00315.75
7.1.200.0070.00415.73
7.1.190.0090.00615.43
7.1.180.0080.00815.86
7.1.170.0060.00315.52
7.1.160.0110.00715.80
7.1.150.0140.00315.55
7.1.140.0030.01015.82
7.1.130.0190.00015.73
7.1.120.0090.00915.67
7.1.110.0080.00815.64
7.1.100.0030.01216.77
7.1.90.0070.01015.92
7.1.80.0070.00715.69
7.1.70.0060.00416.37
7.1.60.0110.00917.57
7.1.50.0110.00816.27
7.1.40.0100.00315.88
7.1.30.0090.00615.62
7.1.20.0110.00615.73
7.1.10.0140.00315.65
7.1.00.0050.02218.81
7.0.330.0060.00614.89
7.0.320.0070.01115.12
7.0.310.0090.00615.35
7.0.300.0070.01115.02
7.0.290.0050.00515.29
7.0.280.0060.00915.16
7.0.270.0100.00715.13
7.0.260.0070.01015.39
7.0.250.0100.00615.36
7.0.240.0060.01215.53
7.0.230.0030.01315.29
7.0.220.0100.00615.15
7.0.210.0130.00315.49
7.0.200.0310.00815.20
7.0.190.0120.00315.42
7.0.180.0070.00415.58
7.0.170.0100.00715.50
7.0.160.0060.00615.37
7.0.150.0130.00315.29
7.0.140.0080.03818.74
7.0.130.0070.00715.09
7.0.120.0060.00915.17
7.0.110.0090.00615.00
7.0.100.0040.00715.32
7.0.90.0090.00615.36
7.0.80.0100.00315.30
7.0.70.0070.00715.19
7.0.60.0050.04517.74
7.0.50.0160.03616.61
7.0.40.0070.04516.76
7.0.30.0190.04316.78
7.0.20.0130.03116.70
7.0.10.0120.02416.69
7.0.00.0030.02816.61
5.6.380.0070.01014.27
5.6.370.0080.00014.47
5.6.360.0060.00614.42
5.6.350.0030.01414.18
5.6.340.0030.01314.55
5.6.330.0100.00314.00
5.6.320.0070.00714.17
5.6.310.0100.00614.30
5.6.300.0040.00714.09
5.6.290.0080.00314.22
5.6.280.0030.04217.50
5.6.270.0100.00314.41
5.6.260.0080.00414.19
5.6.250.0090.00414.26
5.6.240.0030.00914.31
5.6.230.0070.00714.31
5.6.220.0060.01014.14
5.6.210.0070.03217.35
5.6.200.0100.04016.23
5.6.190.0070.04517.37
5.6.180.0210.03917.31
5.6.170.0150.04217.41
5.6.160.0100.02617.21
5.6.150.0100.03616.18
5.6.140.0060.02516.09
5.6.130.0020.02616.21
5.6.120.0030.04717.64
5.6.110.0020.03017.74
5.6.100.0090.02917.70
5.6.90.0100.03017.80
5.6.80.0080.04517.33
5.6.70.0080.04217.27
5.6.60.0090.00614.42
5.6.50.0090.00414.31
5.6.40.0100.01014.56
5.6.30.0090.00914.32
5.6.20.0080.01114.47
5.6.10.0040.01314.27
5.6.00.0090.00914.16
5.5.380.0060.00510.96
5.5.370.0060.00311.10
5.5.360.0040.00411.18
5.5.350.0090.03715.77
5.5.340.0050.03414.66
5.5.330.0060.04515.70
5.5.320.0080.02315.52
5.5.310.0180.03115.71
5.5.300.0100.03814.60
5.5.290.0050.04414.45
5.5.280.0070.03715.93
5.5.270.0040.03115.90
5.5.260.0090.04215.99
5.5.250.0130.03015.85
5.5.240.0030.04515.63
5.5.230.0000.01111.09
5.5.220.0000.01111.20
5.5.210.0090.00011.05
5.5.200.0090.00310.86
5.5.190.0080.00511.28
5.5.180.0030.00911.16
5.5.170.0090.00311.23
5.5.160.0080.00611.01
5.5.150.0030.01010.68
5.5.140.0060.00611.22
5.5.130.0040.00811.04
5.5.120.0030.01011.26
5.5.110.0050.00911.17
5.5.100.0070.00711.20
5.5.90.0030.01010.89
5.5.80.0100.00311.13
5.5.70.0000.01210.99
5.5.60.0070.00411.27
5.5.50.0060.00611.07
5.5.40.0090.00311.25
5.5.30.0060.00610.89
5.5.20.0040.00710.90
5.5.10.0030.00910.88
5.5.00.0000.01010.62
5.4.450.0380.03515.20
5.4.440.0510.03315.12
5.4.430.0250.03715.37
5.4.420.0400.03215.16
5.4.410.0380.03215.25
5.4.400.0180.02914.95
5.4.390.0240.02614.75
5.4.380.0120.03314.90
5.4.370.0140.02614.71
5.4.360.0070.03114.89
5.4.350.0100.02611.57
5.4.340.0080.02611.40
5.4.330.0040.00411.18
5.4.320.0070.02011.62
5.4.310.0040.02411.72
5.4.300.0040.02311.71
5.4.290.0070.02411.59
5.4.280.0040.02011.49
5.4.270.0040.02211.72
5.4.260.0040.02711.61
5.4.250.0060.02814.88
5.4.240.0030.03014.79
5.4.230.0060.03314.72
5.4.220.0050.03314.93
5.4.210.0050.03314.87
5.4.200.0060.02814.94
5.4.190.0110.02714.91
5.4.180.0070.02714.96
5.4.170.0020.03314.84
5.4.160.0080.02514.88
5.4.150.0060.03014.90
5.4.140.0030.03113.63
5.4.130.0050.02813.57
5.4.120.0050.02713.78
5.4.110.0050.02513.74
5.4.100.0080.02313.74
5.4.90.0100.02113.63
5.4.80.0030.02913.74
5.4.70.0050.02813.79
5.4.60.0060.02713.65
5.4.50.0060.02813.51
5.4.40.0070.02513.65
5.4.30.0060.02713.70
5.4.20.0050.02713.78
5.4.10.0050.02513.74
5.4.00.0070.02513.46
5.3.290.0070.02311.80
5.3.280.0080.02512.57
5.3.270.0050.03012.71
5.3.260.0030.03212.66
5.3.250.0100.04012.55
5.3.240.0050.02812.72
5.3.230.0050.02812.65
5.3.220.0060.02512.42
5.3.210.0030.03012.56
5.3.200.0050.03112.57
5.3.190.0120.02212.57
5.3.180.0050.02812.63
5.3.170.0030.02912.50
5.3.160.0020.04112.53
5.3.150.0000.03312.60
5.3.140.0090.02312.53
5.3.130.0040.03012.62
5.3.120.0090.02712.52
5.3.110.0050.03112.45
5.3.100.0050.03012.29
5.3.90.0050.02712.39
5.3.80.0020.02812.26
5.3.70.0020.03012.17
5.3.60.0040.02812.24
5.3.50.0050.02812.20
5.3.40.0020.03212.19
5.3.30.0030.02912.25
5.3.20.0090.02011.90
5.3.10.0070.02311.95
5.3.00.0090.03311.79
5.2.170.0080.02210.27
5.2.160.0070.01710.35
5.2.150.0050.02210.38
5.2.140.0050.02310.35
5.2.130.0060.02110.27
5.2.120.0050.02110.38
5.2.110.0070.02010.35
5.2.100.0030.02510.15
5.2.90.0050.02210.36
5.2.80.0070.02210.29
5.2.70.0090.02010.23
5.2.60.0050.02310.18
5.2.50.0050.02310.27
5.2.40.0070.02110.15
5.2.30.0070.04010.23
5.2.20.0100.01810.19
5.2.10.0070.01810.04
5.2.00.0070.02810.02
5.1.60.0130.0109.54
5.1.50.0050.0189.74
5.1.40.0080.0159.64
5.1.30.0030.0209.82
5.1.20.0050.0209.78
5.1.10.0080.0189.77
5.1.00.0060.0199.64
5.0.50.0020.0188.92
5.0.40.0010.0168.87
5.0.30.0030.0238.72
5.0.20.0020.0168.63
5.0.10.0020.0168.75
5.0.00.0030.0228.81
4.4.90.0050.0128.31
4.4.80.0050.0108.31
4.4.70.0020.0178.31
4.4.60.0020.0138.31
4.4.50.0030.0128.31
4.4.40.0020.0198.31
4.4.30.0000.0138.31
4.4.20.0050.0108.31
4.4.10.0050.0108.31
4.4.00.0020.0208.31
4.3.110.0030.0128.31
4.3.100.0030.0128.31
4.3.90.0000.0158.31
4.3.80.0000.0208.31
4.3.70.0020.0108.31
4.3.60.0030.0118.31
4.3.50.0020.0128.31
4.3.40.0020.0188.31
4.3.30.0020.0138.31
4.3.20.0000.0148.31
4.3.10.0050.0098.31
4.3.00.0050.0158.04

preferences:
45.14 ms | 401 KiB | 5 Q