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:
33.71 ms | 402 KiB | 5 Q