3v4l.org

run code in 300+ PHP versions simultaneously
<?php $expr1 = null; $expr2 = 'expr2'; $expr3 = 'expr3'; $result = ($expr1) ? ($expr2) : ($expr3); var_dump($result); if (true === $expr1) { $result = $expr2; } else { $result = $expr3; } var_dump($result); $result = ($expr1) ?: ($expr3); var_dump($result); if (true === $expr1) { $result = $expr1; } else { $result = $expr3; } var_dump($result); $result = ($expr1) ?? ($expr3); var_dump($result); if (null !== $expr1) { $result = $expr1; } else { $result = $expr3; } var_dump($result);

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.3.140.0080.00016.53
8.3.130.0050.00318.58
8.3.120.0040.01518.80
8.3.110.0000.00816.50
8.3.100.0030.00524.06
8.3.90.0110.00718.54
8.3.80.0060.00316.62
8.3.70.0150.00016.58
8.3.60.0110.00416.38
8.3.50.0140.00318.21
8.3.40.0030.01218.76
8.3.30.0030.01618.59
8.3.20.0040.00424.18
8.3.10.0090.00024.66
8.3.00.0080.00026.16
8.2.250.0080.00018.20
8.2.240.0060.00317.11
8.2.230.0060.00620.94
8.2.220.0100.00037.54
8.2.210.0000.00826.77
8.2.200.0090.00016.50
8.2.190.0110.00416.63
8.2.180.0140.00725.92
8.2.170.0110.00418.96
8.2.160.0140.00722.96
8.2.150.0020.00525.66
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0070.00020.96
8.2.110.0060.00320.38
8.2.100.0060.00617.84
8.2.90.0040.00419.22
8.2.80.0090.00018.03
8.2.70.0050.00517.50
8.2.60.0050.00317.48
8.2.50.0000.00817.50
8.2.40.0030.00517.63
8.2.30.0060.00317.76
8.2.20.0040.00418.06
8.2.10.0070.00019.32
8.2.00.0000.00719.24
8.1.300.0060.00317.92
8.1.290.0080.00430.84
8.1.280.0070.01125.92
8.1.270.0040.00424.02
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0030.00620.82
8.1.230.0070.00317.70
8.1.220.0060.00317.79
8.1.210.0030.00518.77
8.1.200.0060.00317.10
8.1.190.0000.00819.01
8.1.180.0000.00818.10
8.1.170.0000.00817.62
8.1.160.0040.00420.90
8.1.150.0040.00418.70
8.1.140.0050.00318.96
8.1.130.0040.00417.38
8.1.120.0030.00617.45
8.1.110.0040.00417.39
8.1.100.0050.00317.44
8.1.90.0060.00317.48
8.1.80.0000.00817.50
8.1.70.0000.00817.35
8.1.60.0000.00817.61
8.1.50.0040.00417.58
8.1.40.0030.00517.58
8.1.30.0030.00517.62
8.1.20.0060.00317.57
8.1.10.0060.00317.42
8.1.00.0040.00417.38
8.0.300.0040.00418.77
8.0.290.0000.00716.75
8.0.280.0080.00017.93
8.0.270.0000.00716.83
8.0.260.0090.00016.82
8.0.250.0090.00016.96
8.0.240.0000.00617.01
8.0.230.0040.00416.95
8.0.220.0000.00716.82
8.0.210.0070.00016.78
8.0.200.0040.00416.83
8.0.190.0070.00016.86
8.0.180.0000.00716.96
8.0.170.0000.00816.92
8.0.160.0040.00416.75
8.0.150.0070.00016.77
8.0.140.0000.00716.91
8.0.130.0050.00013.30
8.0.120.0060.00316.75
8.0.110.0040.00416.95
8.0.100.0040.00416.89
8.0.90.0060.00216.79
8.0.80.0030.00516.74
8.0.70.0020.00616.96
8.0.60.0050.00316.82
8.0.50.0060.00216.90
8.0.30.0040.00416.91
8.0.20.0020.00516.95
8.0.10.0040.00317.03
8.0.00.0020.00616.92
7.4.330.0000.00515.55
7.4.320.0030.00316.65
7.4.300.0070.00016.48
7.4.290.0080.00016.38
7.4.280.0070.00016.65
7.4.270.0070.00016.56
7.4.260.0030.00313.40
7.4.250.0070.00016.54
7.4.240.0030.00316.52
7.4.230.0030.00316.51
7.4.220.0050.00216.47
7.4.210.0010.00616.53
7.4.200.0020.00616.44
7.4.190.0070.00116.52
7.4.180.0030.00516.67
7.4.160.0010.00716.62
7.4.150.0060.00216.60
7.4.140.0030.00316.35
7.4.130.0040.00316.33
7.4.120.0000.00716.47
7.4.110.0050.00216.31
7.4.100.0030.00316.33
7.4.90.0010.00616.52
7.4.80.0040.00416.41
7.4.70.0060.00216.39
7.4.60.0030.00516.51
7.4.50.0000.00716.47
7.4.40.0010.00616.44
7.4.30.0030.00316.54
7.4.20.0040.00416.46
7.4.10.0020.00516.42
7.4.00.0030.00316.38
7.3.330.0070.00016.16
7.3.320.0030.00313.04
7.3.310.0040.00416.28
7.3.300.0030.00316.12
7.3.290.0040.00416.27
7.3.280.0050.00216.29
7.3.270.0050.00316.25
7.3.260.0000.00716.18
7.3.250.0030.00316.29
7.3.240.0050.00216.14
7.3.230.0030.00316.27
7.3.220.0020.00516.18
7.3.210.0070.00016.22
7.3.200.0040.00416.21
7.3.190.0020.00616.24
7.3.180.0030.00316.13
7.3.170.0050.00216.15
7.3.160.0050.00216.22
7.3.150.0040.00316.20
7.3.140.0000.00716.24
7.3.130.0020.00516.13
7.3.120.0040.00316.18
7.3.110.0030.00316.16
7.3.100.0020.00516.12
7.3.90.0020.00516.41
7.3.80.0030.00416.19
7.3.70.0020.00516.31
7.3.60.0020.00516.37
7.3.50.0000.00716.33
7.3.40.0030.00316.39
7.3.30.0050.00216.25
7.3.20.0000.00816.36
7.3.10.0000.00716.22
7.3.00.0040.00416.28

preferences:
19.2 ms | 403 KiB | 5 Q