3v4l.org

run code in 300+ PHP versions simultaneously
<?php function NC($x){ $y = array(); $y['test'] = $x; $returnThis = $y['test'] ?? "Foo"; return $returnThis; } NC(NULL); // I know this will return "Foo". /* But I have no clue about what these will return. */ var_dump(NC(0)); var_dump(NC(-1)); var_dump(NC("")); var_dump(NC(array());

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)
5.6.130.0270.05018.23
5.6.120.0100.08321.15
5.6.110.0070.08320.97
5.6.100.0130.05320.99
5.6.90.0030.04021.00
5.6.80.0100.07020.53
5.6.70.4530.03720.43
5.5.290.0030.06317.92
5.5.280.0030.08720.68
5.5.270.0070.04020.87
5.5.260.0130.07720.75
5.5.250.0070.08320.59
5.5.240.0300.07020.14
5.4.450.0570.05319.70
5.4.440.0670.06019.16
5.4.430.0670.05019.47
5.4.420.0630.05719.62
5.4.410.0670.05719.34
5.4.400.0470.06019.38
5.4.390.0570.05319.10
5.4.380.0600.05319.23
5.4.370.0500.06719.01
5.4.360.0570.05719.30
5.4.350.0600.05719.25
5.4.340.0770.05018.83
5.4.320.0570.06019.18
5.4.310.0400.05319.21
5.4.300.0500.08318.97
5.4.290.0670.06719.28
5.4.280.0500.05718.98
5.4.270.0430.06019.30
5.4.260.0470.06019.08
5.4.250.0730.07019.05
5.4.240.0570.06018.96
5.4.230.0670.04719.11
5.4.220.0570.06019.13
5.4.210.0800.05019.18
5.4.200.0730.05017.00
5.4.190.0600.05018.97
5.4.180.0730.05019.09
5.4.170.0870.05018.99
5.4.160.0570.06019.17
5.4.150.0630.05719.12
5.4.140.0570.04016.34
5.4.130.0630.04716.52
5.4.120.0570.06016.41
5.4.110.0430.05316.47
5.4.100.0500.04716.30
5.4.90.0700.05016.27
5.4.80.0500.05016.54
5.4.70.0500.05016.27
5.4.60.0600.03716.52
5.4.50.0530.04316.70
5.4.40.0530.04716.29
5.4.30.0500.05016.52
5.4.20.0470.05316.52
5.4.10.0500.04316.48
5.4.00.0570.06016.00

preferences:
141.92 ms | 1394 KiB | 7 Q