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.45
8.5.20.0110.00619.84
8.5.10.0100.00816.74
8.5.00.0090.01220.27
8.4.180.0120.00925.74
8.4.170.0120.01023.91
8.4.160.0130.00723.93
8.4.150.0080.00516.85
8.4.140.0150.00617.70
8.4.130.0130.00817.89
8.4.120.0130.00720.39
8.4.110.0100.01020.38
8.4.100.0120.00917.90
8.4.90.0100.00917.70
8.4.80.0110.00917.73
8.4.70.0110.00917.83
8.4.60.0040.00417.55
8.4.50.0140.00618.61
8.4.40.0040.00417.75
8.4.30.0110.00718.52
8.4.20.0120.00818.07
8.4.10.0090.00019.59
8.3.300.0120.00822.60
8.3.290.0120.00820.82
8.3.280.0060.00616.22
8.3.270.0140.00616.50
8.3.260.0040.00416.73
8.3.250.0110.00818.58
8.3.240.0110.00916.58
8.3.230.0080.01216.64
8.3.220.0040.00417.05
8.3.210.0100.00716.67
8.3.200.0130.00716.60
8.3.190.0110.00718.50
8.3.180.0120.00616.57
8.3.170.0130.00618.91
8.3.160.0090.00918.32
8.3.150.0070.01020.73
8.3.140.0150.00419.02
8.3.130.0040.01122.43
8.3.120.0040.00418.79
8.3.110.0060.00620.94
8.3.100.0090.00018.71
8.3.90.0040.00426.77
8.3.80.0050.00518.43
8.3.70.0180.00716.38
8.3.60.0120.00316.75
8.3.50.0180.00316.69
8.3.40.0140.00321.77
8.3.30.0110.00319.21
8.3.20.0070.00024.18
8.3.10.0070.00024.66
8.3.00.0110.00726.16
8.2.300.0150.00718.17
8.2.290.0110.00720.33
8.2.280.0110.00816.93
8.2.270.0040.00419.05
8.2.260.0070.01018.74
8.2.250.0110.00816.78
8.2.240.0090.00917.09
8.2.230.0050.00322.58
8.2.220.0090.00024.06
8.2.210.0120.00626.77
8.2.200.0050.00518.21
8.2.190.0170.00716.75
8.2.180.0180.00418.54
8.2.170.0060.00918.81
8.2.160.0030.01022.96
8.2.150.0090.00025.66
8.2.140.0060.00324.66
8.2.130.0000.00726.16
8.2.120.0040.00419.48
8.2.110.0130.01022.13
8.2.100.0160.00620.61
8.2.90.0070.01520.69
8.2.80.0110.01120.49
8.2.70.0200.00320.62
8.2.60.0170.00720.66
8.2.50.0090.00920.50
8.2.40.0090.00020.68
8.2.30.0180.00320.39
8.2.20.0140.00320.57
8.2.10.0050.00520.41
8.2.00.0120.00020.59
8.1.340.0110.01019.73
8.1.330.0110.00916.70
8.1.320.0100.00916.44
8.1.310.0000.00818.59
8.1.300.0120.00319.78
8.1.290.0030.00630.84
8.1.280.0140.01125.92
8.1.270.0140.00424.66
8.1.260.0080.00026.35
8.1.250.0000.00828.09
8.1.240.0120.00620.40
8.1.230.0100.01020.54
8.1.220.0100.01320.27
8.1.210.0000.01121.52
8.1.200.0030.00720.16
8.1.190.0070.01120.27
8.1.180.0070.01020.05
8.1.170.0110.00020.27
8.1.160.0030.00720.16
8.1.150.0120.00620.41
8.1.140.0080.00320.33
8.1.130.0030.00720.23
8.1.120.0030.00720.20
8.1.110.0100.00020.20
8.1.100.0160.00620.20
8.1.90.0070.00320.33
8.1.80.0140.00320.29
8.1.70.0090.01220.20
8.1.60.0140.00720.54
8.1.50.0000.01020.49
8.1.40.0000.00920.41
8.1.30.0120.00920.42
8.1.20.0030.00620.50
8.1.10.0030.00720.40
8.1.00.0120.00320.51
8.0.300.0000.00919.81
8.0.290.0110.00019.77
8.0.280.0140.00719.68
8.0.270.0170.00319.68
8.0.260.0170.00319.73
8.0.250.0150.00419.71
8.0.240.0170.00319.66
8.0.230.0130.00319.77
8.0.220.0140.00719.69
8.0.210.0060.00319.73
8.0.200.0100.00319.70
8.0.190.0060.00319.61
8.0.180.0090.00019.77
8.0.170.0040.01219.76
8.0.160.0030.00619.59
8.0.150.0040.00419.70
8.0.140.0070.01019.66
8.0.130.0090.01219.59
8.0.120.0070.01419.49
8.0.110.0100.00619.87
8.0.100.0100.00619.61
8.0.90.0150.00319.70
8.0.80.0030.00619.61
8.0.70.0090.00019.70
8.0.60.0040.00419.69
8.0.50.0030.00619.70
8.0.30.0120.00819.58
8.0.20.0090.00019.73
8.0.10.0090.00019.87

preferences:
68.86 ms | 1113 KiB | 5 Q