3v4l.org

run code in 300+ PHP versions simultaneously
<?php class first { public function getI() { static $a = null; if ($a = null) { $a = new stdClass(); } return $a; } } function foo() { static $a = 1; $a++; print $a."\n"; } var_export($a); foo(); var_export($a); foo(); var_export($a); foo(); var_export($a); foo(); var_export($a); $f = new first(); $n = $f->getI(); var_export($n); var_export($a);

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.0110.00716.75
8.3.50.0130.00622.96
8.3.40.0140.00018.77
8.3.30.0150.00019.25
8.3.20.0070.00020.37
8.3.10.0030.00520.52
8.3.00.0080.00019.25
8.2.180.0130.00316.88
8.2.170.0110.00322.96
8.2.160.0110.00620.27
8.2.150.0070.00024.18
8.2.140.0060.00324.66
8.2.130.0000.00726.16
8.2.120.0040.00420.95
8.2.110.0000.01122.17
8.2.100.0060.00618.22
8.2.90.0030.00619.23
8.2.80.0080.00017.97
8.2.70.0080.00017.63
8.2.60.0080.00017.93
8.2.50.0080.00018.07
8.2.40.0030.00718.16
8.2.30.0080.00019.31
8.2.20.0050.00217.91
8.2.10.0050.00218.00
8.2.00.0040.00417.86
8.1.280.0070.01425.92
8.1.270.0050.00323.91
8.1.260.0070.00026.35
8.1.250.0000.00728.09
8.1.240.0050.00523.75
8.1.230.0080.00419.05
8.1.220.0080.00017.74
8.1.210.0030.00618.77
8.1.200.0070.00317.23
8.1.190.0000.00917.23
8.1.180.0080.00018.10
8.1.170.0000.00818.47
8.1.160.0000.00722.12
8.1.150.0000.00718.80
8.1.140.0070.00017.51
8.1.130.0000.00717.87
8.1.120.0040.00417.43
8.1.110.0000.00717.46
8.1.100.0040.00417.43
8.1.90.0110.00017.43
8.1.80.0040.00417.28
8.1.70.0000.00717.37
8.1.60.0000.00817.47
8.1.50.0050.00317.43
8.1.40.0080.00017.41
8.1.30.0040.00417.61
8.1.20.0040.00417.63
8.1.10.0040.00417.55
8.1.00.0040.00417.40
8.0.300.0040.00418.77
8.0.290.0050.00216.88
8.0.280.0040.00418.32
8.0.270.0030.00317.27
8.0.260.0030.00317.37
8.0.250.0000.00817.01
8.0.240.0070.00016.89
8.0.230.0070.00016.91
8.0.220.0030.00316.94
8.0.210.0030.00316.96
8.0.200.0070.00016.99
8.0.190.0050.00316.96
8.0.180.0030.00516.96
8.0.170.0050.00316.98
8.0.160.0050.00316.82
8.0.150.0040.00416.85
8.0.140.0070.00016.93
8.0.130.0040.00413.34
8.0.120.0060.00316.95
8.0.110.0040.00416.88
8.0.100.0070.00017.00
8.0.90.0000.00716.82
8.0.80.0070.01416.85
8.0.70.0000.00716.92
8.0.60.0000.00817.02
8.0.50.0000.00716.92
8.0.30.0120.00917.06
8.0.20.0140.00417.40
8.0.10.0070.00017.00
8.0.00.0080.00816.75
7.4.330.0000.00515.08
7.4.320.0030.00316.55
7.4.300.0030.00316.42
7.4.290.0070.00016.53
7.4.280.0030.00516.55
7.4.270.0030.00316.58
7.4.260.0030.00716.42
7.4.250.0020.00516.51
7.4.240.0040.00416.55
7.4.230.0000.00716.32
7.4.220.0140.00316.50
7.4.210.0060.00916.54
7.4.200.0050.00216.67
7.4.160.0130.01316.35
7.4.150.0130.01317.40
7.4.140.0080.01317.86
7.4.130.0040.01216.47
7.4.120.0100.01016.56
7.4.110.0150.00416.49
7.4.100.0030.01316.52
7.4.90.0060.01116.45
7.4.80.0100.00619.39
7.4.70.0040.01416.50
7.4.60.0100.00616.61
7.4.50.0000.00416.47
7.4.40.0140.00316.35
7.4.30.0030.01316.67
7.4.00.0130.00514.95
7.3.330.0060.00013.16
7.3.320.0000.00613.39
7.3.310.0000.00816.34
7.3.300.0070.00016.40
7.3.290.0060.00916.38
7.3.280.0060.00916.36
7.3.270.0130.00717.40
7.3.260.0090.00916.38
7.3.250.0130.00716.41
7.3.240.0080.00816.59
7.3.230.0040.01516.43
7.3.210.0100.00616.50
7.3.200.0030.01319.39
7.3.190.0100.01316.54
7.3.180.0040.01216.37
7.3.170.0060.00716.48
7.3.160.0170.00016.46
7.3.120.0060.01214.96
7.3.110.0070.01014.96
7.3.100.0070.01014.89
7.3.90.0090.00914.89
7.3.80.0060.01014.95
7.3.70.0060.00614.79
7.3.60.0000.01114.64
7.3.50.0030.01314.88
7.3.40.0030.00614.87
7.3.30.0030.00914.70
7.3.20.0040.01116.26
7.3.10.0090.00016.71
7.3.00.0070.00716.72
7.2.330.0120.01216.57
7.2.320.0100.00916.78
7.2.310.0120.00616.70
7.2.300.0160.00316.67
7.2.290.0100.01316.67
7.2.250.0070.01114.86
7.2.240.0100.01015.08
7.2.230.0130.00615.22
7.2.220.0060.00615.24
7.2.210.0060.00314.96
7.2.200.0000.01415.03
7.2.190.0060.00615.06
7.2.180.0070.01014.96
7.2.170.0000.01414.88
7.2.00.0060.00819.42
7.1.330.0030.00915.90
7.1.320.0000.01315.65
7.1.310.0030.01015.73
7.1.300.0030.01015.64
7.1.290.0130.00315.81
7.1.280.0030.01015.70
7.1.270.0070.00315.68
7.1.260.0070.00415.53
7.1.100.0000.01317.87
7.1.70.0000.00717.23
7.1.60.0070.01719.61
7.1.50.0090.00916.85
7.1.00.0100.07022.47
7.0.200.0030.00716.77
7.0.140.0100.06721.92
7.0.60.0030.04019.92
7.0.50.0030.08317.94
7.0.40.0100.06320.24
7.0.30.0270.06020.08
7.0.20.0400.07320.10
7.0.10.0200.06020.11
7.0.00.0230.06320.07
5.6.280.0030.07321.10
5.6.210.0100.07320.63
5.6.200.0100.04718.15
5.6.190.0030.08720.64
5.6.180.0370.07720.48
5.6.170.0200.07020.71
5.6.160.0030.08720.61
5.6.150.0100.04718.23
5.6.140.0130.06318.28
5.6.130.0330.03718.29
5.6.120.0100.05720.94
5.6.110.0100.04020.89
5.6.100.0070.08021.12
5.6.90.0030.04021.13
5.6.80.0100.06320.41
5.5.350.0170.07020.39
5.5.340.0070.05317.98
5.5.330.0030.08320.41
5.5.320.0370.04320.36
5.5.310.0200.07720.20
5.5.300.0030.07718.10
5.5.290.0070.04318.06
5.5.280.0070.05720.80
5.5.270.0030.04720.79
5.5.260.0030.08320.97
5.5.250.0070.04320.68
5.5.240.0100.07020.27
5.4.450.0200.04019.41
5.4.440.0130.04019.34
5.4.430.0230.02719.27
5.4.420.0130.03019.46
5.4.410.0030.05019.35
5.4.400.0070.03318.88
5.4.390.0100.05019.09
5.4.380.0500.06318.48
5.4.370.0270.05318.71
5.4.360.0370.04318.59
5.4.350.0270.05318.74
5.4.340.0170.06018.62
5.4.320.0090.03712.51
5.4.310.0080.03712.50
5.4.300.0070.03512.51
5.4.290.0030.04112.50
5.4.280.0070.03912.40
5.4.270.0060.03712.40
5.4.260.0070.04412.40
5.4.250.0100.03412.40
5.4.240.0030.04012.40
5.4.230.0070.04312.39
5.4.220.0030.04012.39
5.4.210.0030.03812.39
5.4.200.0030.04912.39
5.4.190.0040.04212.39
5.4.180.0060.03812.39
5.4.170.0030.03912.40
5.4.160.0040.03912.39
5.4.150.0090.03712.39
5.4.140.0060.03812.07
5.4.130.0050.03812.06
5.4.120.0080.03712.02
5.4.110.0080.03212.02
5.4.100.0070.04012.02
5.4.90.0100.05312.02
5.4.80.0040.04312.02
5.4.70.0080.03312.02
5.4.60.0060.03712.02
5.4.50.0040.03712.01
5.4.40.0070.03912.00
5.4.30.0080.03912.00
5.4.20.0150.03312.00
5.4.10.0070.04212.00
5.4.00.0090.03311.48
5.3.290.0080.04512.80
5.3.280.0080.03912.70
5.3.270.0090.04612.73
5.3.260.0100.04012.71
5.3.250.0120.03812.72
5.3.240.0040.04012.72
5.3.230.0110.04012.70
5.3.220.0090.04012.68
5.3.210.0130.03912.68
5.3.200.0060.04612.68
5.3.190.0080.03812.68
5.3.180.0110.03712.67
5.3.170.0080.04312.67
5.3.160.0070.04112.68
5.3.150.0090.04412.67
5.3.140.0120.03512.66
5.3.130.0080.04512.65
5.3.120.0120.03612.66
5.3.110.0120.04612.66
5.3.100.0060.03712.12
5.3.90.0120.04612.11
5.3.80.0060.04012.09
5.3.70.0060.03712.09
5.3.60.0050.04012.08
5.3.50.0080.03512.03
5.3.40.0070.04112.03
5.3.30.0060.03511.99
5.3.20.0070.03311.77
5.3.10.0080.03711.73
5.3.00.0030.03911.72
5.2.170.0060.0309.23
5.2.160.0050.0309.23
5.2.150.0040.0369.23
5.2.140.0050.0319.22
5.2.130.0060.0309.18
5.2.120.0090.0329.18
5.2.110.0100.0289.19
5.2.100.0060.0349.19
5.2.90.0100.0339.18
5.2.80.0110.0329.18
5.2.70.0070.0309.18
5.2.60.0080.0349.13
5.2.50.0040.0309.10
5.2.40.0040.0369.07
5.2.30.0070.0369.05
5.2.20.0060.0329.04
5.2.10.0080.0298.95
5.2.00.0090.0288.82
5.1.60.0080.0278.10
5.1.50.0040.0328.09
5.1.40.0070.0278.07
5.1.30.0060.0338.43
5.1.20.0040.0318.44
5.1.10.0050.0268.16
5.1.00.0060.0288.16
5.0.50.0060.0216.65
5.0.40.0030.0246.50
5.0.30.0050.0376.32
5.0.20.0050.0236.29
5.0.10.0050.0246.26
5.0.00.0030.0316.25
4.4.90.0020.0164.78
4.4.80.0030.0164.75
4.4.70.0030.0154.75
4.4.60.0020.0164.76
4.4.50.0030.0154.77
4.4.40.0030.0254.71
4.4.30.0030.0154.76
4.4.20.0030.0144.85
4.4.10.0020.0184.85
4.4.00.0030.0264.76
4.3.110.0040.0164.67
4.3.100.0010.0174.67
4.3.90.0020.0154.63
4.3.80.0050.0224.59
4.3.70.0040.0134.63
4.3.60.0040.0144.63
4.3.50.0040.0144.63
4.3.40.0030.0244.54
4.3.30.0020.0163.30
4.3.20.0020.0163.28
4.3.10.0020.0163.23
4.3.00.0030.01718.16

preferences:
34.87 ms | 400 KiB | 5 Q