[php-src] Issue #22618: ext/uri: RFC 3986 IPv6 handling is inconsistent

From: Date: Mon, 06 Jul 2026 15:57:16 +0000
Subject: [php-src] Issue #22618: ext/uri: RFC 3986 IPv6 handling is inconsistent
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-252357@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/22618 Author: JKingweb ### Description The following code: ```php <?php $u = new Uri\Rfc3986\Uri("http://[::0:0A]/"); var_dump($u->getRawHost()); var_dump($u->getHost()); var_dump($u->toRawString()); var_dump($u->toString()); ``` Resulted in this output: ``` string(8) "[::0:0A]" string(8) "[::0:0a]" string(49) "http://[0000:0000:0000:0000:0000:0000:0000:000a]/" string(49) "http://[0000:0000:0000:0000:0000:0000:0000:000a]/" ``` But I expected this output instead: ``` string(8) "[::0:0A]" string(8) "[0000:0000:0000:0000:0000:0000:0000:000a]" string(49) "http://[::0:0A]/" string(49) "http://[0000:0000:0000:0000:0000:0000:0000:000a]/" ``` Alternatively I might expect this output: ``` string(8) "[::0:0A]" string(8) "[::a]" string(49) "http://[::0:0A]/" string(49) "http://[::a]/" ``` ### PHP Version ```plain PHP 8.5.8 (cli) (built: Jul 1 2026 16:35:50) (NTS) Copyright (c) The PHP Group Zend Engine v4.5.8, Copyright (c) Zend Technologies with Zend OPcache v8.5.8, Copyright (c), by Zend Technologies ``` ### Operating System Arch Linux

« previous php.bugs (#252357) next »