3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $url = 'http://foo.bar?asd=qwe?bans=asf'; $urlComponents = parse_url($url); var_dump($urlComponents);exit; $urlComponents['query'] = array_merge($$urlComponents['query'], http_build_query($parameters)); return http_build_url($$urlComponents); var_dump($foo);
based on HGSM1
Output for 4.3.2 - 7.2.0
array(3) { ["scheme"]=> string(4) "http" ["host"]=> string(7) "foo.bar" ["query"]=> string(16) "asd=qwe?bans=asf" }
Output for 4.3.0 - 4.3.1
array(2) { ["scheme"]=> string(4) "http" ["host"]=> string(24) "foo.bar?asd=qwe?bans=asf" }