3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(parse_url("http://www.realself.com/foo/bar?utm_source=wubba&utm_content=bubba#myhash")); $null = null; print_r(is_null(parse_url("http://example.com", PHP_URL_QUERY))); ?>
Output for 5.1.2 - 7.2.0
array(5) { ["scheme"]=> string(4) "http" ["host"]=> string(16) "www.realself.com" ["path"]=> string(8) "/foo/bar" ["query"]=> string(34) "utm_source=wubba&utm_content=bubba" ["fragment"]=> string(6) "myhash" } 1
Output for 4.3.0 - 5.1.1
array(5) { ["scheme"]=> string(4) "http" ["host"]=> string(16) "www.realself.com" ["path"]=> string(8) "/foo/bar" ["query"]=> string(34) "utm_source=wubba&utm_content=bubba" ["fragment"]=> string(6) "myhash" } Notice: Use of undefined constant PHP_URL_QUERY - assumed 'PHP_URL_QUERY' in /in/RgTK0 on line 5 Warning: parse_url() expects exactly 1 parameter, 2 given in /in/RgTK0 on line 5 1