3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public $define; // null public $redefine; // null public function define(?bool $something = null): ?bool { return $this->define = $this->define ?? $something; } public function redefine(?bool $something = null): ?bool { return $this->redefine = $something ?? $this->redefine; } } $test = function(?bool $value) { var_export($value ?? 'Not set!' ?: 'False!'); echo PHP_EOL; }; $foo = new Test(); $test($foo->define()); $test($foo->define(true)); $test($foo->define()); $test($foo->define(false)); $test($foo->define()); $test($foo->redefine()); $test($foo->redefine(true)); $test($foo->redefine()); $test($foo->redefine(false)); $test($foo->redefine());

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.5.10.0060.00316.77
8.5.00.0110.01120.18
8.4.160.0130.00923.85
8.4.150.0020.00014.05
8.4.140.0110.01217.70
8.4.130.0120.00917.98
8.4.120.0130.00720.34
8.4.110.0110.00920.57
8.4.100.0090.01118.69
8.4.90.0050.00420.56
8.4.80.0090.00918.70
8.4.70.0080.01117.86
8.4.60.0120.00618.98
8.4.50.0100.01019.47
8.4.40.0130.00719.37
8.4.30.0080.01118.59
8.4.20.0100.01019.53
8.4.10.0060.00319.35
8.3.280.0020.00014.05
8.3.270.0100.01016.48
8.3.260.0070.00416.70
8.3.250.0100.00818.79
8.3.240.0070.01016.71
8.3.230.0050.00416.80
8.3.220.0140.00518.93
8.3.210.0130.00618.55
8.3.200.0030.00516.63
8.3.190.0070.01116.61
8.3.180.0100.00918.96
8.3.170.0190.00019.22
8.3.160.0140.00416.74
8.3.150.0190.00018.96
8.3.140.0030.00518.42
8.3.130.0090.00018.39
8.3.120.0160.00319.02
8.3.110.0040.00416.75
8.3.100.0110.00024.06
8.3.90.0000.00826.77
8.3.80.0060.00316.75
8.3.70.0140.00416.58
8.3.60.0140.00716.88
8.3.50.0090.00923.70
8.3.40.0060.00921.85
8.3.30.0140.00018.64
8.3.20.0070.00024.18
8.3.10.0000.00724.66
8.3.00.0060.00326.16
8.2.290.0090.01020.38
8.2.280.0100.00818.21
8.2.270.0060.01317.06
8.2.260.0110.00719.04
8.2.250.0060.00316.99
8.2.240.0090.00317.08
8.2.230.0150.00620.94
8.2.220.0030.00737.54
8.2.210.0040.00426.77
8.2.200.0030.00616.50
8.2.190.0130.01016.75
8.2.180.0090.00625.92
8.2.170.0000.02119.16
8.2.160.0040.01122.96
8.2.150.0040.00425.66
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0070.00026.35
8.2.110.0100.00020.47
8.2.100.0120.00017.53
8.2.90.0040.00417.63
8.2.80.0080.00018.86
8.2.70.0040.00417.63
8.2.60.0030.00517.75
8.2.50.0000.00817.55
8.2.40.0040.00418.22
8.2.30.0050.00218.07
8.2.20.0070.00018.07
8.2.10.0000.00719.15
8.2.00.0000.00719.31
8.1.330.0080.01121.98
8.1.320.0050.00416.18
8.1.310.0060.01216.97
8.1.300.0120.00620.11
8.1.290.0000.01218.88
8.1.280.0060.01625.92
8.1.270.0000.00823.99
8.1.260.0040.00428.09
8.1.250.0000.00728.09
8.1.240.0030.00723.82
8.1.230.0060.00620.99
8.1.220.0000.00818.69
8.1.210.0000.00818.77
8.1.200.0000.00817.35
8.1.190.0030.00517.23
8.1.180.0060.00318.10
8.1.170.0060.00318.86
8.1.160.0070.00018.91
8.1.150.0000.00818.91
8.1.140.0030.00520.71
8.1.130.0040.00420.16
8.1.120.0000.00717.50
8.1.110.0040.00417.48
8.1.100.0050.00517.40
8.1.90.0050.00217.36
8.1.80.0040.00417.48
8.1.70.0030.00317.38
8.1.60.0090.00017.61
8.1.50.0050.00317.47
8.1.40.0000.00917.57
8.1.30.0080.00017.57
8.1.20.0040.00417.59
8.1.10.0030.00617.56
8.1.00.0040.00417.42
8.0.300.0040.00418.77
8.0.290.0080.00016.63
8.0.280.0040.00418.46
8.0.270.0030.00317.93
8.0.260.0000.00618.50
8.0.250.0030.00317.03
8.0.240.0030.00517.02
8.0.230.0030.00316.97
8.0.220.0070.00016.92
8.0.210.0070.00016.95
8.0.200.0030.00317.07
8.0.190.0030.00316.96
8.0.180.0070.00416.89
8.0.170.0080.00016.86
8.0.160.0050.00516.91
8.0.150.0030.00516.82
8.0.140.0050.00316.80
8.0.130.0040.00313.31
8.0.120.0030.00516.88
8.0.110.0000.00716.78
8.0.100.0030.00516.71
8.0.90.0000.00816.77
8.0.80.0080.01016.90
8.0.70.0000.00716.80
8.0.60.0080.00016.89
8.0.50.0030.00616.88
8.0.30.0120.00617.17
8.0.20.0130.00917.15
8.0.10.0040.00417.00
8.0.00.0110.00816.76
7.4.330.0050.00015.55
7.4.320.0000.00616.52
7.4.300.0000.00716.38
7.4.290.0030.00616.38
7.4.280.0040.00416.50
7.4.270.0040.00416.58
7.4.260.0050.00013.32
7.4.250.0050.00216.58
7.4.240.0040.00416.48
7.4.230.0000.00716.61
7.4.220.0050.00216.57
7.4.210.0110.00616.60
7.4.200.0000.00716.42
7.4.130.0130.00516.68
7.4.120.0130.01016.30
7.4.110.0130.00716.46
7.4.100.0090.01316.48
7.4.90.0070.01116.23
7.4.80.0110.01416.13
7.4.70.0100.01316.59
7.4.60.0150.00416.45
7.4.50.0130.00816.22
7.4.40.0100.01016.20
7.4.30.0140.01016.48
7.4.20.0170.00616.24
7.4.10.0120.01216.33
7.4.00.0150.00316.48
7.3.330.0030.00716.30
7.3.320.0040.00413.31
7.3.310.0060.00316.33
7.3.300.0000.00616.32
7.3.290.0060.01216.29
7.3.260.0000.01816.25
7.3.240.0140.00416.42
7.3.230.0130.00716.22
7.3.220.0180.00616.27
7.3.210.0070.01616.35
7.3.200.0090.01116.64
7.3.190.0150.00316.13
7.3.180.0150.00916.46
7.3.170.0100.01016.29
7.3.160.0140.00316.27
7.3.150.0150.00616.13
7.3.140.0130.01016.38
7.3.130.0130.00616.42
7.3.120.0090.00916.22
7.3.110.0030.01616.45
7.3.100.0180.00216.31
7.3.90.0140.01016.31
7.3.80.0060.01516.58
7.3.70.0120.00916.53
7.3.60.0130.00616.20
7.3.50.0150.00316.10
7.3.40.0070.01116.23
7.3.30.0070.01116.34
7.3.20.0120.00916.32
7.3.10.0100.01016.25
7.3.00.0100.01016.51
7.2.340.0040.01616.46
7.2.330.0100.01016.70
7.2.320.0100.01116.62
7.2.310.0090.01216.48
7.2.300.0180.00316.58
7.2.290.0100.01016.60
7.2.280.0130.01016.34
7.2.270.0060.01216.48
7.2.260.0100.01016.51
7.2.250.0040.01316.11
7.2.240.0120.00616.71
7.2.230.0120.01216.66
7.2.220.0140.00716.49
7.2.210.0090.01016.37
7.2.200.0090.00916.39
7.2.190.0060.01316.46
7.2.180.0130.00716.62
7.2.170.0100.01016.41
7.2.160.0150.00816.32
7.2.150.0180.00316.64
7.2.140.0120.00916.27
7.2.130.0230.00316.28
7.2.120.0070.01816.41
7.2.110.0170.00716.45
7.2.100.0110.00816.42
7.2.90.0060.01916.47
7.2.80.0150.00816.24
7.2.70.0130.00716.27
7.2.60.0110.00716.64
7.2.50.0120.00816.57
7.2.40.0070.01116.27
7.2.30.0070.01116.48
7.2.20.0140.00716.52
7.2.10.0030.01616.43
7.2.00.0210.00716.46

preferences:
39.18 ms | 403 KiB | 5 Q