3v4l.org

run code in 300+ PHP versions simultaneously
<?php $null = null; // Fatal error: var_export($null->someMethod() ?? null); //echo "\n---\n"; // Fatal error: var_export($null->someMethod()->city ?? null); //echo "\n---\n"; // Fatal error: var_export($null->someMethod()?->city ?? null); //echo "\n---\n"; var_export($null?->someMethod() ?? "null coalesced"); // ^-- null-safe operator required before method call echo "\n---\n"; var_export($null?->property?->someMethod() ?? "null coalesced"); // ^----------^-- null-safe operators required before method call echo "\n---\n"; var_export($null->property->anotherProperty ?? "null coalesced"); // ^---------^-- NO METHODS CALLED, SO NO NULL-SAFE OPERATORS REQUIRED echo "\n---\n"; var_export($null?->property?->someMethod()->anotherProperty ?? "null coalesced"); // ^ ^ ^-- NO NULL-SAFE OPERATORS REQUIRED IF NO SUBSEQUENT METHODS CALLED // |----------|-- nulls-safe operators required before method call

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.00.0140.00819.96
8.4.150.0020.00014.05
8.4.140.0130.00817.18
8.4.130.0120.00917.84
8.4.120.0130.00720.52
8.4.110.0140.00718.98
8.4.100.0120.01017.75
8.4.90.0070.00219.63
8.4.80.0100.01017.84
8.4.70.0100.01017.73
8.4.60.0030.00619.54
8.4.50.0110.00818.67
8.4.40.0100.01017.65
8.4.30.0070.01318.93
8.4.20.0070.01319.46
8.4.10.0060.00919.57
8.3.280.0020.00014.05
8.3.270.0120.00816.49
8.3.260.0100.00916.42
8.3.250.0120.00618.62
8.3.240.0040.00416.57
8.3.230.0090.00916.51
8.3.220.0110.00816.58
8.3.210.0140.00416.54
8.3.200.0070.00816.57
8.3.190.0120.00817.00
8.3.180.0070.00119.04
8.3.170.0200.00016.63
8.3.160.0150.00317.21
8.3.150.0090.00917.32
8.3.140.0030.00618.43
8.3.130.0130.00318.13
8.3.120.0080.00820.51
8.3.110.0100.01016.50
8.3.100.0080.00424.06
8.3.90.0110.00726.77
8.3.80.0090.00018.43
8.3.70.0040.01116.50
8.3.60.0070.01418.41
8.3.50.0120.00316.68
8.3.40.0030.01021.89
8.3.30.0140.00022.11
8.3.20.0140.00725.66
8.3.10.0140.00725.66
8.3.00.0140.00725.66
8.2.290.0150.00519.00
8.2.280.0110.00817.03
8.2.270.0180.00016.43
8.2.260.0110.00716.71
8.2.250.0060.00318.36
8.2.240.0030.00618.73
8.2.230.0040.00420.94
8.2.220.0090.00037.54
8.2.210.0060.00326.77
8.2.200.0070.00316.75
8.2.190.0070.00716.63
8.2.180.0080.00816.63
8.2.170.0090.00618.93
8.2.160.0080.00622.96
8.2.150.0070.01425.66
8.2.140.0140.00725.66
8.2.130.0100.01025.66
8.2.120.0100.01025.66
8.2.110.0100.01025.66
8.2.100.0040.01825.66
8.2.90.0120.00925.66
8.2.80.0100.01025.66
8.2.70.0120.00925.66
8.2.60.0170.00325.66
8.2.50.0080.01525.66
8.2.40.0110.01125.66
8.2.30.0120.00625.66
8.2.20.0150.00425.66
8.2.10.0140.00725.66
8.2.00.0090.01225.66
8.1.330.0130.00615.93
8.1.320.0100.00915.95
8.1.310.0000.01116.13
8.1.300.0060.00320.36
8.1.290.0080.00330.84
8.1.280.0120.00925.92
8.1.270.0110.00425.66
8.1.260.0150.00625.66
8.1.250.0160.00925.66
8.1.240.0120.00425.66
8.1.230.0070.01025.66
8.1.220.0120.00425.66
8.1.210.0060.00925.66
8.1.200.0130.00325.66
8.1.190.0110.00725.66
8.1.180.0070.01025.66
8.1.170.0060.00925.66
8.1.160.0160.00025.66
8.1.150.0120.00325.66
8.1.140.0070.00725.66
8.1.130.0070.01025.66
8.1.120.0060.01325.66
8.1.110.0120.00325.66
8.1.100.0040.01225.66
8.1.90.0150.00025.66
8.1.80.0070.01425.66
8.1.70.0160.00725.66
8.1.60.0070.01325.66
8.1.50.0070.00725.66
8.1.40.0130.00325.66
8.1.30.0120.00325.66
8.1.20.0040.01125.66
8.1.10.0040.01125.66
8.1.00.0120.00325.66
7.4.330.0170.00725.66

preferences:
78.45 ms | 403 KiB | 5 Q