3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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"; }
based on IXYWe
Output for 7.2.0
test.com Warning: Use of undefined constant url - assumed 'url' (this will throw an Error in a future version of PHP) in /in/npYcd on line 9 url
Output for 5.3.22 - 7.1.10
test.com Notice: Use of undefined constant url - assumed 'url' in /in/npYcd on line 9 url