3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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 5.3.0 - 7.1.0
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 4.3.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://: