3v4l.org

run code in 300+ PHP versions simultaneously
<?php function curPageURL() { $pageURL = 'http'; if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} $pageURL .= "://"; if ($_SERVER["SERVER_PORT"] != "80") { $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; } else { $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; } return $pageURL; } echo curPageURL();
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Warning: Undefined array key "HTTPS" in /in/qrN8o on line 4 Warning: Undefined array key "SERVER_PORT" in /in/qrN8o on line 6 Warning: Undefined array key "SERVER_NAME" in /in/qrN8o on line 7 Warning: Undefined array key "SERVER_PORT" in /in/qrN8o on line 7 Warning: Undefined array key "REQUEST_URI" in /in/qrN8o on line 7 http://:
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.38, 7.0.0 - 7.0.33, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Notice: Undefined index: HTTPS in /in/qrN8o on line 4 Notice: Undefined index: SERVER_PORT in /in/qrN8o on line 6 Notice: Undefined index: SERVER_NAME in /in/qrN8o on line 7 Notice: Undefined index: SERVER_PORT in /in/qrN8o on line 7 Notice: Undefined index: REQUEST_URI in /in/qrN8o on line 7 http://:
Output for 7.3.32 - 7.3.33
http://:
Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Notice: Undefined index: HTTPS in /in/qrN8o on line 4 Notice: Undefined index: SERVER_PORT in /in/qrN8o on line 6 Notice: Undefined index: SERVER_NAME in /in/qrN8o on line 7 Notice: Undefined index: SERVER_PORT in /in/qrN8o on line 7 Notice: Undefined index: REQUEST_URI in /in/qrN8o on line 7 http://:

preferences:
257.82 ms | 403 KiB | 421 Q