parse_url is inconsistent with specified port (#64604)

This is a basic fix for https://bugs.php.net/bug.php?id=64604
As discussed with @yohgaki in #509 a separate ticket will be opened for the TLD issue (see comments in the ticket) to identify the hostname and I'm going to ask in the internals mailinglist soon for opinions about possible solutions.