3v4l.org

run code in 300+ PHP versions simultaneously
<?hh class Foo { function get(): ?int { static $called = false; if (!$called) { $called = true; return 42; } return null; } } function doStuff(Foo $foo) { var_dump($foo->get() ? $foo->get() : 'was null the first time'); } doStuff(new Foo());

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.00418.17
8.3.50.0170.00220.96
8.3.40.0140.00318.71
8.3.30.0080.00618.85
8.3.20.0000.00720.02
8.3.10.0040.00423.54
8.3.00.0080.00019.25
8.2.180.0120.00318.04
8.2.170.0040.01122.96
8.2.160.0100.00320.26
8.2.150.0080.00024.18
8.2.140.0090.00024.66
8.2.130.0030.00526.16
8.2.120.0080.00020.89
8.2.110.0090.00022.19
8.2.100.0060.00617.63
8.2.90.0050.00219.17
8.2.80.0000.00817.97
8.2.70.0090.00017.50
8.2.60.0090.00017.91
8.2.50.0040.00818.07
8.2.40.0000.00817.96
8.2.30.0000.00717.84
8.2.20.0000.00717.54
8.2.10.0000.00717.91
8.2.00.0000.00817.42
8.1.280.0070.00725.92
8.1.270.0060.00323.97
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0090.00023.88
8.1.230.0080.00419.15
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0030.00617.22
8.1.190.0030.00516.88
8.1.180.0040.00418.10
8.1.170.0050.00318.33
8.1.160.0040.00421.93
8.1.150.0040.00418.71
8.1.140.0000.00717.25
8.1.130.0070.00017.67
8.1.120.0080.00017.32
8.1.110.0000.00717.34
8.1.100.0000.00717.32
8.1.90.0000.00817.37
8.1.80.0030.00317.28
8.1.70.0030.00317.29
8.1.60.0080.00017.46
8.1.50.0050.00317.36
8.1.40.0040.00417.39
8.1.30.0040.00417.46
8.1.20.0040.00417.53
8.1.10.0080.00017.44
8.1.00.0040.00417.40
8.0.300.0000.00718.77
8.0.290.0000.00716.75
8.0.280.0000.00718.28
8.0.270.0000.00717.18
8.0.260.0030.00317.26
8.0.250.0030.00316.69
8.0.240.0050.00216.83
8.0.230.0030.00316.85
8.0.220.0070.00016.71
8.0.210.0030.00516.81
8.0.200.0040.00416.80
8.0.190.0030.00316.84
8.0.180.0030.00916.81
8.0.170.0000.00816.74
8.0.160.0040.00416.65
8.0.150.0000.00716.68
8.0.140.0070.00016.70
8.0.130.0030.00313.34
8.0.120.0040.00416.72
8.0.110.0000.00716.73
8.0.100.0040.00416.64
8.0.90.0000.00716.63
8.0.80.0090.00616.71
8.0.70.0040.00416.86
8.0.60.0000.00716.57
8.0.50.0000.00716.79
8.0.30.0130.00616.93
8.0.20.0170.00317.40
8.0.10.0000.00716.88
8.0.00.0150.00316.49
7.4.330.0020.00315.08
7.4.320.0040.00416.32
7.4.300.0030.00316.21
7.4.290.0030.00316.37
7.4.280.0000.00716.25
7.4.270.0030.00316.27
7.4.260.0030.00316.45
7.4.250.0000.00716.48
7.4.240.0050.00216.44
7.4.230.0030.00316.44
7.4.220.0040.01416.49
7.4.210.0030.01016.43
7.4.200.0070.00016.46
7.4.160.0060.01016.23
7.4.150.0110.00717.40
7.4.140.0090.01217.86
7.4.130.0090.00916.43
7.4.120.0110.00516.24
7.4.110.0160.00316.64
7.4.100.0090.00916.40
7.4.90.0100.00916.51
7.4.80.0080.01519.39
7.4.70.0060.01016.45
7.4.60.0070.01416.38
7.4.50.0000.00716.34
7.4.40.0060.01216.25
7.4.30.0100.00616.29
7.3.330.0000.00613.01
7.3.320.0050.00012.97
7.3.310.0040.00416.05
7.3.300.0000.00716.11
7.3.290.0080.00916.12
7.3.280.0070.00816.10
7.3.270.0160.00717.40
7.3.260.0140.00416.12
7.3.250.0090.01016.32
7.3.240.0070.01116.23
7.3.230.0120.00616.39
7.3.210.0070.01016.52
7.3.200.0090.01219.39
7.3.190.0060.00916.31
7.3.180.0090.00616.33
7.3.170.0000.01616.36
7.3.160.0120.00416.22
7.2.330.0060.01216.38
7.2.320.0040.01416.63
7.2.310.0030.01316.38
7.2.300.0090.00916.50
7.2.290.0120.00916.52
5.4.340.0080.03212.01
5.4.320.0050.03612.45
5.4.310.0060.03712.45
5.4.300.0060.03612.45
5.4.290.0070.03712.45
5.4.280.0040.03612.34
5.4.270.0070.03512.35
5.4.260.0050.03912.35
5.4.250.0040.03912.35
5.4.240.0050.03712.35
5.4.230.0050.03912.34
5.4.220.0050.03812.34
5.4.210.0090.03712.34
5.4.200.0050.03912.34
5.4.190.0050.03912.34
5.4.180.0070.03612.34
5.4.170.0050.03812.35
5.4.160.0060.03712.34
5.4.150.0050.03712.34
5.4.140.0060.03612.02
5.4.130.0040.03612.01
5.4.120.0080.03811.96
5.4.110.0080.04511.96
5.4.100.0030.03811.96
5.4.90.0020.03911.96
5.4.80.0050.03711.96
5.4.70.0070.03211.96
5.4.60.0040.03511.96
5.4.50.0060.03311.96
5.4.40.0030.03711.95
5.4.30.0070.03411.95
5.4.20.0050.03411.94
5.4.10.0090.02911.95
5.4.00.0050.03511.43

preferences:
47.31 ms | 401 KiB | 5 Q