3v4l.org

run code in 300+ PHP versions simultaneously
<?php $urls = [ 'https://mon.domaine.fr/le/chemin/vers/le/fichier.php?mes=1&demandes=2', 'ftps://login:password@domain.com/path/to/file.txt', 'http://www.example.com:80/forum/questions/?tag=networking&order=newest#top', '/usr/bin/awk', 'http://localhost/index.html#uneID', 'tel:0780111111' ]; foreach ($urls as $url) { print_r(parse_url($url)); }
Output for 8.1.23 - 8.1.33, 8.2.6 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
Array ( [scheme] => https [host] => mon.domaine.fr [path] => /le/chemin/vers/le/fichier.php [query] => mes=1&demandes=2 ) Array ( [scheme] => ftps [host] => domain.com [user] => login [pass] => password [path] => /path/to/file.txt ) Array ( [scheme] => http [host] => www.example.com [port] => 80 [path] => /forum/questions/ [query] => tag=networking&order=newest [fragment] => top ) Array ( [path] => /usr/bin/awk ) Array ( [scheme] => http [host] => localhost [path] => /index.html [fragment] => uneID ) Array ( [scheme] => tel [path] => 0780111111 )

preferences:
83.7 ms | 408 KiB | 5 Q