3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $toto = "http://mercure-ws1.vente.francetelecom.fr/ProjetMercure/servlet/accesauxapplis/.jsp?task=GererAccesAuxApplications&ctrl_choix_appli=NEPT"; @ $url = parse_url($toto); @ $port = $url['port']; if($port != "") @ $uri = $url['host'].":".$port; else @ $uri = $url['host']; echo var_dump($url);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(4) { ["scheme"]=> string(4) "http" ["host"]=> string(34) "mercure-ws1.vente.francetelecom.fr" ["path"]=> string(42) "/ProjetMercure/servlet/accesauxapplis/.jsp" ["query"]=> string(52) "task=GererAccesAuxApplications&ctrl_choix_appli=NEPT" }