Skip to content

Uri\Rfc3986\Uri::toString() doesn't drop an empty port #23965

Description

@kamil-tekiela

Description

The following code:

<?php

require 'vendor/autoload.php';

$uri = new Uri\Rfc3986\Uri('https://example.com:');
var_dump($uri->getPort(), $uri->toRawString(), $uri->toString());

Resulted in this output:

NULL
string(20) "https://example.com:"
string(20) "https://example.com:"

But I expected this output instead:

NULL
string(20) "https://example.com:"
string(19) "https://example.com"

PHP Version

8.5.4

Operating System

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions