3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $url = "http://foobar.com/foo/bar/1?baz=qux#fragment/foo"; echo basename(parse_url($url, PHP_URL_PATH));
based on SVUEA
Output for 5.1.2 - 7.2.0
1
Output for 4.3.0 - 5.1.1
Notice: Use of undefined constant PHP_URL_PATH - assumed 'PHP_URL_PATH' in /in/kank7 on line 4 Warning: parse_url() expects exactly 1 parameter, 2 given in /in/kank7 on line 4