So... PHP and Javascript comparison.... Parsing a URL: PHP: var_Dump(parse_url('...

@heiglandreas@phpc.social

So... PHP and Javascript comparison....

Parsing a URL:

PHP:
var_Dump(parse_url('example.com:80'));
array(2) {
["host"]=>
string(11) "example.com"
["port"]=>
int(80)
}

JavaScript:
a = new URL('example.com:80');
URL {
href: "example.com:80",
origin: "null",
protocol: "example.com:",
username: "",
password: "",
host: "",
hostname: "",
port: "",
pathname: "80",
search: ""
}

I know which side *I* stick with....

#PHP #JavaScript