3v4l.org

run code in 300+ PHP versions simultaneously
<?php class NullableA { private function __construct() {} public ?string $string; public static function &string(?string $defaultValue = null) { $type = new self; $type->string = $defaultValue; return $type->string; // type is garbage collected } } class NullableB { private static $antiGarbageCollect = []; private function __construct() {} public ?string $string; public static function &string(?string $defaultValue = null) { $type = new self; self::$antiGarbageCollect[] = $type; $type->string = $defaultValue; return $type->string; } } $a =& NullableA::string(); $a = 123; var_dump($a); $b =& NullableB::string(); $b = 123; var_dump($b);

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.4.140.0120.01017.65
8.4.130.0080.00918.66
8.4.120.0110.00824.16
8.4.110.0130.00718.75
8.4.100.0050.00519.00
8.4.90.0120.00518.86
8.4.80.0130.00719.00
8.4.70.0090.01117.88
8.4.60.0050.00420.38
8.4.50.0130.00817.74
8.4.40.0100.00719.18
8.4.30.0090.00020.33
8.4.20.0140.00720.75
8.4.10.0090.00017.82
8.3.270.0150.00516.42
8.3.260.0100.01016.68
8.3.250.0020.00618.87
8.3.240.0100.00717.15
8.3.230.0140.00516.30
8.3.220.0100.00919.14
8.3.210.0120.00718.54
8.3.200.0040.00416.50
8.3.190.0110.00417.23
8.3.180.0090.00718.16
8.3.170.0160.00316.68
8.3.160.0090.00916.78
8.3.150.0180.00317.04
8.3.140.0090.00617.05
8.3.130.0090.00018.46
8.3.120.0110.00420.71
8.3.110.0040.00418.29
8.3.100.0030.00616.75
8.3.90.0090.00016.48
8.3.80.0050.00518.31
8.3.70.0040.01116.50
8.3.60.0170.00316.75
8.3.50.0130.00521.12
8.3.40.0120.00318.79
8.3.30.0070.00718.81
8.3.20.0030.00621.73
8.3.10.0000.00920.40
8.3.00.0070.00023.61
8.2.290.0110.01120.25
8.2.280.0090.00318.50
8.2.270.0060.01216.62
8.2.260.0030.00518.92
8.2.250.0070.00718.18
8.2.240.0000.01117.19
8.2.230.0000.00920.94
8.2.220.0110.00024.06
8.2.210.0080.00026.77
8.2.200.0060.00318.29
8.2.190.0100.00616.63
8.2.180.0170.00316.63
8.2.170.0060.00922.96
8.2.160.0100.00319.27
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0050.00226.16
8.2.120.0020.00521.05
8.2.110.0090.00020.57
8.2.100.0060.00617.84
8.2.90.0000.00917.75
8.2.80.0080.00017.97
8.2.70.0000.00818.03
8.2.60.0000.00818.22
8.2.50.0050.00318.10
8.2.40.0040.00419.32
8.2.30.0030.00619.15
8.2.20.0000.00818.07
8.2.10.0040.00419.39
8.2.00.0000.00719.19
8.1.330.0130.00522.00
8.1.320.0120.00716.36
8.1.310.0040.00416.74
8.1.300.0060.00319.76
8.1.290.0090.00018.88
8.1.280.0110.00725.92
8.1.270.0130.00621.96
8.1.260.0070.00726.35
8.1.250.0000.00728.09
8.1.240.0040.00822.09
8.1.230.0080.00320.95
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0000.00817.25
8.1.190.0000.00817.22
8.1.180.0040.00418.10
8.1.170.0050.00320.26
8.1.160.0070.00018.86
8.1.150.0000.00718.90
8.1.140.0000.00720.83
8.1.130.0000.00720.00
8.1.120.0000.00717.31
8.1.110.0030.00517.37
8.1.100.0050.00317.42
8.1.90.0040.00417.47
8.1.80.0000.01017.38
8.1.70.0030.00317.43
8.1.60.0030.00617.51
8.1.50.0070.00017.57
8.1.40.0000.00817.45
8.1.30.0000.00917.50
8.1.20.0050.00317.61
8.1.10.0030.00517.55
8.1.00.0080.00017.46
8.0.300.0070.00019.79
8.0.290.0020.00516.58
8.0.280.0080.00018.35
8.0.270.0070.00017.27
8.0.260.0000.00719.98
8.0.250.0000.00716.88
8.0.240.0000.00816.82
8.0.230.0090.00016.92
8.0.220.0040.00416.84
8.0.210.0070.00016.88
8.0.200.0000.00716.88
8.0.190.0060.00316.78
8.0.180.0030.00516.88
8.0.170.0000.00916.78
8.0.160.0040.00416.93
8.0.150.0070.00016.74
8.0.140.0070.00016.64
8.0.130.0030.00313.21
8.0.120.0050.00316.78
8.0.110.0000.00716.86
8.0.100.0020.00516.74
8.0.90.0070.00316.85
8.0.80.0030.01216.77
8.0.70.0050.00316.68
8.0.60.0000.00716.71
8.0.50.0000.00716.71
8.0.30.0110.01116.83
8.0.20.0030.01516.98
8.0.10.0000.00816.86
8.0.00.0090.01016.75
7.4.330.0030.00315.55
7.4.320.0030.00316.55
7.4.300.0000.00616.55
7.4.290.0040.00416.64
7.4.280.0040.00416.62
7.4.270.0000.00716.65
7.4.260.0030.00316.61
7.4.250.0070.00016.48
7.4.240.0000.00716.42
7.4.230.0000.00816.67
7.4.220.0020.00516.54
7.4.210.0050.01116.64
7.4.200.0030.00316.28
7.4.140.0080.01717.86
7.4.130.0080.00916.36
7.4.120.0120.00616.62
7.4.110.0150.00716.58
7.4.100.0110.00816.61
7.4.90.0110.00716.42
7.4.80.0100.00719.39
7.4.70.0090.01216.77
7.4.60.0110.00616.24
7.4.50.0060.01016.21
7.4.40.0070.01116.55
7.3.330.0030.00313.07
7.3.320.0000.00613.14
7.3.310.0030.00316.31
7.3.300.0070.00016.14
7.3.290.0030.01216.15
7.3.280.0030.01716.22
7.3.260.0110.00816.17
7.3.240.0100.00916.22
7.3.230.0060.01516.19
7.3.210.0120.00416.32
7.3.200.0150.00616.32
7.3.190.0100.01016.39
7.3.180.0080.00816.45
7.3.170.0040.01116.15
7.3.160.0090.00616.13
7.3.70.0070.00714.59
7.3.60.0060.00614.38
7.3.50.0130.00414.43
7.3.40.0070.01414.36
7.3.30.0050.00514.57
7.3.20.0080.01114.63
7.3.10.0180.00614.53
7.3.00.0160.01014.68
7.2.330.0090.00616.48
7.2.320.0100.00716.43
7.2.310.0050.01116.50
7.2.300.0100.00716.12
7.2.290.0000.01816.50
7.2.200.0030.01714.77
7.2.190.0100.00514.86
7.2.180.0080.00414.79
7.2.170.0090.00614.38
7.2.160.0140.00314.57
7.2.150.0120.00614.69
7.2.140.0140.01114.59
7.2.130.0200.00314.70
7.2.120.0160.01614.70
7.2.110.0170.00714.61
7.2.100.0150.00914.81
7.2.90.0210.00414.79
7.2.80.0230.00815.02
7.2.70.0130.01315.01
7.2.60.0120.01214.56
7.2.50.0150.00614.80
7.2.40.0130.00714.32
7.2.30.0710.01014.89
7.2.20.0140.01014.68
7.2.10.0170.00314.45
7.2.00.0160.00514.79
7.1.300.0250.00613.40
7.1.290.0230.00313.79
7.1.280.0150.00413.43
7.1.270.0170.00713.59
7.1.260.0160.00613.50
7.1.250.0190.00413.67

preferences:
176.99 ms | 403 KiB | 5 Q