3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function y() { $GLOBALS['x'] = null; } 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(); } } $GLOBALS['x'] = new A(); $x = &$GLOBALS['x']; 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.0070.01118.07
8.3.50.0070.00716.64
8.3.40.0100.01018.62
8.3.30.0090.00618.71
8.3.20.0080.00020.38
8.3.10.0050.00323.57
8.3.00.0000.00721.92
8.2.180.0140.00718.10
8.2.170.0100.00722.96
8.2.160.0030.01019.08
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0070.00019.27
8.2.120.0080.00026.35
8.2.110.0130.00319.39
8.2.100.0070.00418.03
8.2.90.0000.00818.07
8.2.80.0100.00017.97
8.2.70.0080.00017.93
8.2.60.0040.00417.93
8.2.50.0000.00918.10
8.2.40.0050.00220.47
8.2.30.0000.00719.38
8.2.20.0040.00418.13
8.2.10.0070.00018.18
8.2.00.0040.00418.08
8.1.280.0140.00325.92
8.1.270.0000.00722.16
8.1.260.0000.00726.35
8.1.250.0070.00028.09
8.1.240.0090.00022.13
8.1.230.0110.00022.63
8.1.220.0050.00317.74
8.1.210.0030.00618.77
8.1.200.0030.00617.23
8.1.190.0040.00417.22
8.1.180.0050.00318.10
8.1.170.0050.00318.98
8.1.160.0070.00019.01
8.1.150.0040.00418.79
8.1.140.0000.00719.49
8.1.130.0030.00318.81
8.1.120.0000.00717.30
8.1.110.0000.00717.41
8.1.100.0050.00317.50
8.1.90.0040.00417.53
8.1.80.0040.00417.52
8.1.70.0000.00817.36
8.1.60.0040.00417.45
8.1.50.0030.00617.43
8.1.40.0050.00317.45
8.1.30.0070.00017.71
8.1.20.0050.00217.49
8.1.10.0000.00917.45
8.1.00.0000.00817.31
8.0.300.0070.00019.62
8.0.290.0000.00816.75
8.0.280.0000.00718.36
8.0.270.0000.00717.14
8.0.260.0000.00716.75
8.0.250.0000.00616.87
8.0.240.0000.00716.96
8.0.230.0030.00316.95
8.0.220.0070.00016.89
8.0.210.0000.00816.89
8.0.200.0000.00816.95
8.0.190.0030.00616.82
8.0.180.0100.00016.92
8.0.170.0040.00416.99
8.0.160.0040.00316.80
8.0.150.0070.00016.84
8.0.140.0050.00316.81
8.0.130.0070.00413.37
8.0.120.0000.00716.77
8.0.110.0080.00016.96
8.0.100.0000.00716.77
8.0.90.0040.00416.86
8.0.80.0080.00816.84
8.0.70.0000.00816.83
8.0.60.0000.00716.89
8.0.50.0070.00016.77
8.0.30.0130.00617.07
8.0.20.0090.00917.40
8.0.10.0050.00316.82
8.0.00.0130.00316.71
7.4.330.0030.00315.55
7.4.320.0000.00716.58
7.4.300.0000.00616.59
7.4.290.0030.00616.61
7.4.280.0000.00716.60
7.4.270.0030.00316.48
7.4.260.0070.00016.48
7.4.250.0000.00716.48
7.4.240.0000.00716.50
7.4.230.0050.00216.61
7.4.220.0030.01416.45
7.4.210.0030.01716.56
7.4.200.0030.00316.60
7.4.160.0090.00716.55
7.4.150.0110.00617.40
7.4.140.0120.00517.86
7.4.130.0120.00616.43
7.4.120.0070.01316.51
7.4.110.0130.00316.50
7.4.100.0070.01016.46
7.4.90.0090.00816.35
7.4.80.0100.00619.39
7.4.70.0090.00716.44
7.4.60.0030.01316.52
7.4.50.0070.01116.53
7.4.40.0060.01116.38
7.4.30.0030.01316.42
7.4.00.0030.01314.85
7.3.330.0050.00213.40
7.3.320.0050.00013.19
7.3.310.0030.00316.19
7.3.300.0070.00016.26
7.3.290.0080.00616.39
7.3.280.0090.00816.35
7.3.270.0140.00317.40
7.3.260.0140.01516.39
7.3.250.0090.00816.58
7.3.240.0070.00916.35
7.3.230.0060.01016.43
7.3.210.0040.01116.60
7.3.200.0090.00616.36
7.3.190.0030.01316.45
7.3.180.0130.00716.45
7.3.170.0130.00316.25
7.3.160.0190.00016.38
7.3.00.0070.00716.46
7.2.330.0060.01216.65
7.2.320.0080.01516.48
7.2.310.0120.00616.53
7.2.300.0080.00816.70
7.2.290.0120.00316.39
7.2.130.0030.00616.88
7.2.120.0070.01016.46
7.2.110.0110.00316.70
7.2.100.0030.01017.07
7.2.90.0130.00016.78
7.2.80.0000.01016.75
7.2.70.0070.00716.70
7.2.60.0140.00316.81
7.2.50.0140.00016.99
7.2.40.0110.00716.89
7.2.30.0090.00616.99
7.2.20.0000.01316.48
7.2.10.0070.00716.63
7.2.00.0070.00316.86
7.1.250.0090.00315.69
7.1.240.0080.00815.43
7.1.230.0090.00915.84
7.1.220.0120.00315.59
7.1.210.0070.00415.83
7.1.200.0050.00715.54
7.1.190.0090.00615.79
7.1.180.0120.00415.66
7.1.170.0080.00615.43
7.1.160.0040.00715.85
7.1.150.0070.00715.74
7.1.140.0070.00715.51
7.1.130.0000.01015.86
7.1.120.0080.00415.73
7.1.110.0040.01215.68
7.1.100.0050.00717.05
7.1.90.0060.00615.65
7.1.80.0000.01015.73
7.1.70.0060.00916.51
7.1.60.0190.00625.46
7.1.50.0160.01425.31
7.1.40.0180.00824.89
7.1.30.0220.00724.93
7.1.20.0130.01125.04
7.1.10.0080.00816.04
7.1.00.0030.01216.17
7.0.330.0040.01515.05
7.0.320.0060.00915.27
7.0.310.0070.00715.35
7.0.300.0100.00715.33
7.0.290.0070.00315.49
7.0.280.0060.00615.44
7.0.270.0100.00315.16
7.0.260.0090.00615.10
7.0.250.0120.00015.41
7.0.240.0000.01315.03
7.0.230.0070.00315.11
7.0.220.0100.00315.44
7.0.210.0070.00715.52
7.0.200.0080.00716.00
7.0.190.0060.01015.75
7.0.180.0030.01415.78
7.0.170.0070.00615.65
7.0.160.0070.00515.62
7.0.150.0060.01015.79
7.0.140.0070.00915.79
7.0.130.0050.00915.89
7.0.120.0110.00615.79
7.0.110.0020.01515.79
7.0.100.0070.00915.73
7.0.90.0070.00815.83
7.0.80.0050.01215.69
7.0.70.0040.01015.89
7.0.60.0050.01115.84
7.0.50.0140.00415.85
7.0.40.0090.00814.92
7.0.30.0060.00914.94
7.0.20.0050.00915.00
7.0.10.0060.00814.84
7.0.00.0060.00715.00
5.6.380.0100.00714.04

preferences:
30.97 ms | 400 KiB | 5 Q