[php-src] Issue #19920: Uri\WhatWg\Url host validation when using withHost with a Host string that ressemble an invalid Ipv4
| From: | nyamsprod | Date: | Mon, 22 Sep 2025 13:21:59 +0000 |
| Subject: | [php-src] Issue #19920: Uri\WhatWg\Url host validation when using withHost with a Host string that ressemble an invalid Ipv4 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-250882@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/19920
Author: nyamsprod
### Description
The following code:
```php
<?php
echo new
\Uri\WhatWg\Url('scheme://host/path')->withHost('333.333.333.333')->toAsciiString();
```
Resulted in this output:
```
scheme://host
```
But I expected this output instead:
```
scheme://333.333.333.333
```
333.333.333.333 is not a valid IPv4 but is a valid registered name so it should not
silently fail at all.
see: https://3v4l.org/un12T/rfc#vgit.master
### PHP Version
```plain
PHP 8.5-dev
```
### Operating System
_No response_