3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = $_GET["u"]; if(parse_url($url, PHP_URL_HOST) === "example.com" ) { echo "<script>window.location.href = '" . htmlspecialchars($url, ENT_QUOTES) . "';</script>"; } else { echo "<script>window.location.href = 'https://example.com';</script>"; }

preferences:
48.88 ms | 405 KiB | 5 Q