3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = [ 'HTTP_REFERER' => 'http_referer' ]; function ternary($test) { return (!empty($test['HTTP_REFERER']) ? $test['HTTP_REFERER'] : (!empty($test['HTTP_ORIGIN']) ? $test['HTTP_ORIGIN'] : (!empty($test['ORIGIN']) ? $test['ORIGIN'] : "Unknown Origin"))); } function verbose($test) { if (!empty($test['HTTP_REFERER'])) { return $test['HTTP_REFERER']; } if (!empty($test['HTTP_ORIGIN'])) { return $test['HTTP_ORIGIN']; } if (!empty($test['ORIGIN'])) { return $test['ORIGIN']; } return 'Unknown Origin'; } echo ternary($test); echo \PHP_EOL; echo verbose($test); echo \PHP_EOL . '---' . \PHP_EOL; $test = [ 'HTTP_ORIGIN' => 'http_origin' ]; echo ternary($test); echo \PHP_EOL; echo verbose($test); echo \PHP_EOL . '---' . \PHP_EOL; $test = [ 'ORIGIN' => 'origin' ]; echo ternary($test); echo \PHP_EOL; echo verbose($test);

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.10.0100.00918.52
8.5.00.0140.00719.87
8.4.150.0030.00014.05
8.4.140.0170.00617.45
8.4.130.0030.00617.90
8.4.120.0110.00924.05
8.4.110.0090.01021.77
8.4.100.0050.00519.00
8.4.90.0100.00918.72
8.4.80.0150.00620.38
8.4.70.0050.00718.00
8.4.60.0080.00418.82
8.4.50.0070.00418.81
8.4.40.0130.00617.92
8.4.30.0170.00317.54
8.4.20.0200.00319.40
8.4.10.0130.00017.96
8.3.280.0060.00518.49
8.3.270.0120.00716.56
8.3.260.0130.00817.25
8.3.250.0140.00519.04
8.3.240.0120.00617.05
8.3.230.0120.00516.68
8.3.220.0040.00418.82
8.3.210.0110.00918.61
8.3.200.0040.00516.74
8.3.190.0120.00717.01
8.3.180.0110.00817.04
8.3.170.0040.01120.61
8.3.160.0070.01118.43
8.3.150.0110.01117.21
8.3.140.0120.00616.73
8.3.130.0060.00318.37
8.3.120.0070.00318.92
8.3.110.0100.01020.94
8.3.100.0130.00624.06
8.3.90.0030.00626.77
8.3.80.0060.00317.97
8.3.70.0120.00916.75
8.3.60.0150.00318.43
8.3.50.0110.00318.01
8.3.40.0070.01118.85
8.3.30.0160.00318.70
8.3.20.0040.00420.39
8.3.10.0080.00021.90
8.3.00.0000.00819.85
8.2.290.0090.00720.66
8.2.280.0090.00618.55
8.2.270.0110.00717.12
8.2.260.0070.01118.28
8.2.250.0080.00018.50
8.2.240.0110.00817.38
8.2.230.0050.00522.58
8.2.220.0030.00637.54
8.2.210.0030.00626.77
8.2.200.0060.00316.63
8.2.190.0120.00616.88
8.2.180.0130.00918.66
8.2.170.0040.01118.91
8.2.160.0030.01722.96
8.2.150.0150.00324.18
8.2.140.0040.00424.66
8.2.130.0040.00420.91
8.2.120.0040.00426.16
8.2.110.0030.00620.54
8.2.100.0090.00317.95
8.2.90.0040.00417.78
8.2.80.0040.00418.05
8.2.70.0000.00817.93
8.2.60.0150.00017.68
8.2.50.0060.00318.10
8.2.40.0040.00419.29
8.2.30.0050.00319.54
8.2.20.0050.00318.16
8.2.10.0030.00518.15
8.2.00.0070.00018.38
8.1.330.0080.01022.05
8.1.320.0110.00716.35
8.1.310.0150.00316.80
8.1.300.0090.00016.38
8.1.290.0060.00330.84
8.1.280.0120.00325.92
8.1.270.0000.00820.38
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0090.00317.52
8.1.230.0080.00322.87
8.1.220.0000.00817.74
8.1.210.0040.00418.90
8.1.200.0030.00717.35
8.1.190.0030.00617.25
8.1.180.0000.00818.10
8.1.170.0040.00418.53
8.1.160.0040.00418.84
8.1.150.0040.00420.25
8.1.140.0030.00517.59
8.1.130.0040.00419.03
8.1.120.0000.00817.49
8.1.110.0050.00317.48
8.1.100.0070.00017.54
8.1.90.0000.00817.41
8.1.80.0040.00417.45
8.1.70.0030.00617.39
8.1.60.0030.00617.63
8.1.50.0060.00617.58
8.1.40.0000.00717.50
8.1.30.0040.00417.71
8.1.20.0000.00917.61
8.1.10.0040.00417.59
8.1.00.0000.00817.55
8.0.300.0050.00319.79
8.0.290.0080.00016.75
8.0.280.0070.00018.34
8.0.270.0030.00616.83
8.0.260.0030.00316.76
8.0.250.0030.00317.05
8.0.240.0030.00317.09
8.0.230.0070.00016.97
8.0.220.0000.00716.94
8.0.210.0030.00316.82
8.0.200.0030.00316.86
8.0.190.0030.00516.96
8.0.180.0040.00416.92
8.0.170.0030.00616.84
8.0.160.0050.00216.87
8.0.150.0000.00716.93
8.0.140.0050.00316.91
8.0.130.0030.00313.39
8.0.120.0050.00216.79
8.0.110.0000.00716.99
8.0.100.0070.00016.82
8.0.90.0040.00416.99
8.0.80.0090.01216.93
8.0.70.0000.00716.77
8.0.60.0040.00416.98
8.0.50.0000.00816.99
8.0.30.0040.01117.21
8.0.20.0090.00917.40
8.0.10.0060.00316.96
8.0.00.0110.00916.64
7.4.330.0040.00015.55
7.4.320.0000.01016.63
7.4.300.0000.00716.64
7.4.290.0070.00016.51
7.4.280.0040.00416.45
7.4.270.0030.00416.55
7.4.260.0030.00516.62
7.4.250.0070.00016.59
7.4.240.0050.00316.45
7.4.230.0070.00016.57
7.4.220.0000.00816.72
7.4.210.0070.01016.64
7.4.200.0050.00216.73
7.4.160.0100.00816.48
7.4.150.0060.01317.40
7.4.140.0100.01017.86
7.4.130.0080.00816.48
7.4.120.0110.00616.43
7.4.110.0070.01016.52
7.4.100.0070.01016.45
7.4.90.0100.00716.66
7.4.80.0160.00419.39
7.4.70.0100.00716.51
7.4.60.0110.00716.46
7.4.50.0070.01116.42
7.4.40.0120.00416.43
7.4.00.0080.01114.84
7.3.330.0030.00313.38
7.3.320.0060.00013.39
7.3.310.0000.00716.34
7.3.300.0000.00716.37
7.3.290.0060.01216.28
7.3.280.0070.00916.35
7.3.270.0100.00717.40
7.3.260.0090.00816.39
7.3.250.0120.00616.37
7.3.240.0130.00816.33
7.3.230.0070.01016.64
7.3.210.0040.01516.46
7.3.200.0180.00316.38
7.3.190.0060.00916.64
7.3.180.0060.01016.25
7.3.170.0000.01516.34
7.3.160.0100.00616.58
7.3.120.0100.00714.75
7.3.110.0100.00714.87
7.3.100.0060.00614.71
7.3.90.0040.01414.75
7.3.80.0060.00314.85
7.3.70.0060.00914.97
7.3.60.0080.00014.64
7.3.50.0040.00714.84
7.3.40.0040.00814.71
7.3.30.0060.00914.86
7.3.20.0030.00916.80
7.3.10.0050.00916.62
7.3.00.0100.00316.50
7.2.330.0100.00716.38
7.2.320.0090.00916.63
7.2.310.0000.01616.36
7.2.300.0170.00016.38
7.2.290.0070.01616.78
7.2.250.0140.00714.95
7.2.240.0040.01415.00
7.2.230.0080.00814.96
7.2.220.0030.01415.09
7.2.210.0090.00315.01
7.2.200.0030.01414.98
7.2.190.0030.01015.00
7.2.180.0090.00414.73
7.2.170.0030.00914.81
7.2.130.0020.01316.78
7.2.120.0070.00516.91
7.2.110.0060.00816.93
7.2.100.0050.00616.84
7.2.90.0050.00816.82
7.2.80.0050.00916.77
7.2.70.0070.00516.81
7.2.60.0040.00716.85
7.2.50.0070.00616.88
7.2.40.0030.01016.93
7.2.30.0040.00716.91
7.2.20.0050.00816.94
7.2.10.0110.00917.34
7.2.00.0750.00817.24
7.1.330.0090.00615.94
7.1.320.0000.01315.71
7.1.310.0100.00315.48
7.1.300.0060.00315.94
7.1.290.0040.01115.79
7.1.280.0100.00315.54
7.1.270.0110.00315.98
7.1.260.0030.00615.79
7.1.250.0000.00915.76
7.1.240.0000.00716.02
7.1.230.0100.00315.70
7.1.220.0000.00715.69
7.1.210.0030.01015.86
7.1.200.0150.00615.86
7.1.190.0090.00615.61
7.1.180.0110.00315.88
7.1.170.0040.00415.84
7.1.160.0030.00915.71
7.1.150.0030.01015.79
7.1.140.0080.00615.81
7.1.130.0160.00816.26
7.1.120.0080.01216.18
7.1.110.0180.00416.00
7.1.100.0150.00815.87
7.1.90.0160.00715.96
7.1.80.0140.01415.88
7.1.70.0100.01015.61
7.1.60.0230.00724.53
7.1.50.0150.01124.27
7.1.40.0150.01224.20
7.1.30.0180.00824.19
7.1.20.0100.01624.23
7.1.10.0140.00815.29
7.1.00.0140.00615.36
7.0.330.0000.01015.51
5.6.380.0050.00314.67

preferences:
36.04 ms | 403 KiB | 5 Q