3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = 'http://test.com/test'; if (filter_var($url, FILTER_VALIDATE_URL)) { if ($host = parse_url($url, PHP_URL_HOST)) { print $host; } print url; } else { print "Fail"; }

preferences:
40.91 ms | 402 KiB | 5 Q