3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = ['a' => 1, 'c' => 0]; function neverEmpty(&$firstChoice, $alternative) { return empty($firstChoice) ? $alternative : $firstChoice; } foreach (['a', 'b', 'c'] as $k) { var_export(neverEmpty($array[$k], 'nope')); echo "\n"; }

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.30.0110.00619.50
8.5.20.0100.00720.07
8.5.10.0050.01316.89
8.5.00.0120.00919.91
8.4.180.0130.01319.71
8.4.170.0130.00824.04
8.4.160.0140.01323.96
8.4.150.0080.00416.84
8.4.140.0150.00617.71
8.4.130.0120.00917.44
8.4.120.0130.00720.54
8.4.110.0120.00822.48
8.4.100.0130.00717.88
8.4.90.0140.00620.54
8.4.80.0080.00817.68
8.4.70.0050.00317.84
8.4.60.0050.00320.47
8.4.50.0130.00718.52
8.4.40.0050.00317.63
8.4.30.0110.00718.66
8.4.20.0100.01017.85
8.4.10.0030.00619.64
8.3.300.0090.01220.96
8.3.290.0130.00820.82
8.3.280.0110.01218.51
8.3.270.0130.00616.38
8.3.260.0020.00716.49
8.3.250.0140.00518.69
8.3.240.0030.00516.58
8.3.230.0110.00816.51
8.3.220.0040.00416.96
8.3.210.0100.01018.17
8.3.200.0020.00616.71
8.3.190.0070.00716.92
8.3.180.0090.00817.23
8.3.170.0100.01018.80
8.3.160.0070.01017.37
8.3.150.0160.00320.71
8.3.140.0030.00520.52
8.3.130.0060.00318.55
8.3.120.0060.01518.96
8.3.110.0070.00420.94
8.3.100.0060.00318.57
8.3.90.0040.00426.77
8.3.80.0080.00317.97
8.3.70.0090.00616.38
8.3.60.0090.00616.32
8.3.50.0130.00618.25
8.3.40.0070.01021.91
8.3.30.0090.00619.29
8.3.20.0070.00024.18
8.3.10.0070.00024.66
8.3.00.0140.00426.16
8.2.300.0130.00722.20
8.2.290.0090.01020.28
8.2.280.0150.00518.39
8.2.270.0080.00017.38
8.2.260.0000.00917.05
8.2.250.0040.00416.53
8.2.240.0060.00317.22
8.2.230.0070.00422.58
8.2.220.0040.00424.06
8.2.210.0070.01026.77
8.2.200.0070.00318.31
8.2.190.0100.00716.58
8.2.180.0120.00916.73
8.2.170.0060.00918.95
8.2.160.0140.00722.96
8.2.150.0060.00325.66
8.2.140.0000.00824.66
8.2.130.0050.00326.16
8.2.120.0030.00619.48
8.2.110.0110.01122.31
8.2.100.0130.01020.52
8.2.90.0090.01220.68
8.2.80.0100.00720.48
8.2.70.0160.00620.45
8.2.60.0140.00720.62
8.2.50.0100.00020.49
8.2.40.0030.00620.74
8.2.30.0100.00620.27
8.2.20.0150.00720.39
8.2.10.0070.00420.42
8.2.00.0060.00320.29
8.1.340.0090.01019.84
8.1.330.0120.00721.95
8.1.320.0130.00615.96
8.1.310.0040.01416.54
8.1.300.0030.00618.48
8.1.290.0040.00430.84
8.1.280.0130.00625.92
8.1.270.0030.00920.69
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0090.00620.35
8.1.230.0100.01020.39
8.1.220.0110.01120.28
8.1.210.0070.00321.48
8.1.200.0060.00320.26
8.1.190.0120.00920.07
8.1.180.0100.00020.08
8.1.170.0030.01220.10
8.1.160.0070.01420.23
8.1.150.0090.00020.46
8.1.140.0060.00320.23
8.1.130.0060.00320.28
8.1.120.0080.00320.39
8.1.110.0000.00920.29
8.1.100.0060.00620.13
8.1.90.0090.00020.29
8.1.80.0060.00320.13
8.1.70.0190.00020.27
8.1.60.0120.00920.64
8.1.50.0040.00720.52
8.1.40.0070.01120.54
8.1.30.0040.00720.43
8.1.20.0170.00320.41
8.1.10.0070.00320.35
8.1.00.0030.00620.38
8.0.300.0090.00019.70
8.0.290.0060.00319.64
8.0.280.0100.00019.41
8.0.270.0070.00319.68
8.0.260.0040.00819.81
8.0.250.0030.00619.74
8.0.240.0100.00719.77
8.0.230.0100.00019.61
8.0.220.0130.00019.56
8.0.210.0100.00019.56
8.0.200.0090.00019.76
8.0.190.0070.00319.75
8.0.180.0060.00319.75
8.0.170.0030.00619.63
8.0.160.0090.00019.57
8.0.150.0030.00619.62
8.0.140.0060.00319.46
8.0.130.0070.00319.70
8.0.120.0000.01119.61
8.0.110.0060.00319.82
8.0.100.0060.00319.65
8.0.90.0060.00619.48
8.0.80.0060.00319.62
8.0.70.0060.00319.70
8.0.60.0070.00319.60
8.0.50.0030.00619.70
8.0.30.0050.00519.68
8.0.20.0030.00619.74
8.0.10.0050.00519.88

preferences:
71.94 ms | 1106 KiB | 5 Q