Skip to content

Uri\WhatWg\Url Port validation when using withPort #19944

@nyamsprod

Description

@nyamsprod

Description

The following code:

<?php
new \Uri\WhatWg\Url('https://example.com:432')->withPort(-1)->toAsciiString();

Resulted in this output:

'https://example.com:432'

But I expected this output instead:

Uri\WhatWg\InvalidUrlException: The specified port is malformed (PortOutOfRange)

see: https://3v4l.org/q66W3/rfc#vgit.master

PHP Version

PHP 8.5-dev

Operating System

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions