3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function y() { $GLOBALS['x'] = null; return true; } public function z() { echo "Hello World\n"; } } function nullthrows($x) { if ($x === null) { throw new Exception('Unexpected null'); } return $x; } function foo($x) { if ($x && $x->y()) { nullthrows($x)->z(); } } $x = new A(); foo($x);

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.0170.00316.63
8.3.50.0100.00716.39
8.3.40.0140.00018.70
8.3.30.0090.00618.72
8.3.20.0000.00720.29
8.3.10.0040.00423.48
8.3.00.0030.00621.92
8.2.180.0100.01018.36
8.2.170.0100.00722.96
8.2.160.0070.00718.91
8.2.150.0050.00324.18
8.2.140.0060.00324.66
8.2.130.0000.00821.24
8.2.120.0040.00426.35
8.2.110.0100.00022.25
8.2.100.0080.00317.91
8.2.90.0000.00817.97
8.2.80.0030.00517.97
8.2.70.0090.00017.50
8.2.60.0050.00318.16
8.2.50.0050.00318.10
8.2.40.0060.00320.48
8.2.30.0040.00419.21
8.2.20.0080.00018.01
8.2.10.0040.00418.11
8.2.00.0050.00218.05
8.1.280.0100.00725.92
8.1.270.0040.00422.17
8.1.260.0000.00726.35
8.1.250.0000.00828.09
8.1.240.0060.00323.92
8.1.230.0000.01020.84
8.1.220.0000.00917.78
8.1.210.0090.00018.90
8.1.200.0060.00317.35
8.1.190.0030.00517.22
8.1.180.0030.00518.10
8.1.170.0030.00519.03
8.1.160.0030.00318.97
8.1.150.0040.00418.91
8.1.140.0040.00419.54
8.1.130.0030.00318.90
8.1.120.0070.00017.49
8.1.110.0040.00417.41
8.1.100.0070.00017.47
8.1.90.0000.00717.31
8.1.80.0030.00517.36
8.1.70.0030.00317.53
8.1.60.0000.00817.48
8.1.50.0060.00317.43
8.1.40.0060.00317.41
8.1.30.0040.00417.54
8.1.20.0040.00417.59
8.1.10.0030.00617.52
8.1.00.0040.00417.41
8.0.300.0040.00419.82
8.0.290.0050.00316.75
8.0.280.0000.00718.47
8.0.270.0040.00417.26
8.0.260.0030.00316.81
8.0.250.0000.00817.03
8.0.240.0050.00316.84
8.0.230.0000.00716.96
8.0.220.0030.00316.86
8.0.210.0000.00716.94
8.0.200.0050.00216.82
8.0.190.0030.00616.98
8.0.180.0060.00316.91
8.0.170.0030.00516.92
8.0.160.0050.00516.92
8.0.150.0030.00316.81
8.0.140.0000.00716.86
8.0.130.0000.01013.26
8.0.120.0050.00316.86
8.0.110.0000.00716.88
8.0.100.0040.00416.68
8.0.90.0000.00816.93
8.0.80.0130.00316.89
8.0.70.0050.00316.84
8.0.60.0070.00016.84
8.0.50.0040.00416.81
8.0.30.0120.00817.12
8.0.20.0120.00817.40
8.0.10.0030.00517.14
8.0.00.0090.00916.81
7.4.330.0030.00315.55
7.4.320.0000.00716.68
7.4.300.0000.00616.52
7.4.290.0030.00416.55
7.4.280.0050.00316.60
7.4.270.0030.00316.52
7.4.260.0000.00716.47
7.4.250.0040.00416.33
7.4.240.0040.00416.61
7.4.230.0070.00016.44
7.4.220.0140.01016.59
7.4.210.0120.00316.69
7.4.200.0040.00416.46
7.4.160.0110.00616.53
7.4.150.0100.00617.40
7.4.140.0060.01217.86
7.4.130.0140.00616.64
7.4.120.0080.00916.56
7.4.110.0110.00816.46
7.4.100.0150.00616.41
7.4.90.0060.01216.50
7.4.80.0090.00919.39
7.4.70.0150.00416.65
7.4.60.0120.00316.59
7.4.50.0030.01016.55
7.4.40.0130.00316.56
7.4.30.0100.00616.43
7.4.00.0070.00714.83
7.3.330.0060.00013.23
7.3.320.0030.00313.40
7.3.310.0000.00816.36
7.3.300.0040.00416.23
7.3.290.0110.00516.31
7.3.280.0080.00916.35
7.3.270.0070.01017.40
7.3.260.0150.00716.48
7.3.250.0100.00716.43
7.3.240.0110.00616.50
7.3.230.0130.01016.28
7.3.210.0080.00816.60
7.3.200.0070.01016.67
7.3.190.0130.00316.32
7.3.180.0160.00316.37
7.3.170.0090.00916.35
7.3.160.0100.01016.54
7.3.10.0030.01016.68
7.3.00.0070.01016.60
7.2.330.0140.00716.46
7.2.320.0130.00416.54
7.2.310.0110.00816.56
7.2.300.0120.00916.76
7.2.290.0030.01616.42
7.2.130.0060.00916.94
7.2.120.0090.00917.08
7.2.110.0080.00516.89
7.2.100.0030.01516.86
7.2.90.0150.00816.59
7.2.80.0210.00316.92
7.2.70.0210.00616.92
7.2.60.0070.01616.70
7.2.50.0160.00717.06
7.2.40.0130.00416.70
7.2.30.0160.00316.65
7.2.20.0200.00017.05
7.2.10.0130.00016.91
7.2.00.0070.00918.14
7.1.250.0070.00715.60
7.1.200.0000.01415.87
7.1.100.0060.00618.02
7.1.70.0080.00917.25
7.1.60.0240.02335.20
7.1.50.0260.01034.87
7.1.40.0170.02634.42
7.1.30.0240.02034.60
7.1.20.0320.01334.53
7.1.10.0080.01216.44
7.1.00.0100.00716.67
7.0.200.0030.01316.53
7.0.190.0140.00616.77
7.0.180.0030.01716.34
7.0.170.0110.00916.21
7.0.160.0060.01316.34
7.0.150.0090.01216.30
7.0.140.0030.01716.25
7.0.130.0060.01016.39
7.0.120.0130.00316.47
7.0.110.0040.01516.38
7.0.100.0120.00716.30
7.0.90.0000.02016.39
7.0.80.0060.01316.30
7.0.70.0000.01916.29
7.0.60.0050.01616.15
7.0.50.0030.01316.32
7.0.40.0070.01016.55
7.0.30.0080.01316.39
7.0.20.0080.01116.33
7.0.10.0100.00916.32
7.0.00.0120.00616.35

preferences:
37.57 ms | 401 KiB | 5 Q