Re: [RFC] [Discussion] Add WHATWG compliant URL parsing API

From: Date: Mon, 07 Apr 2025 23:27:06 +0000
Subject: Re: [RFC] [Discussion] Add WHATWG compliant URL parsing API
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-127070@lists.php.net to get a copy of this message
Hi Ignace, it might be brought back for future improvements. > > Yes, surely! > I have one last question regarding the URI implementations which are raised by my polyfill: > > Did you also took into account the delimiters when submitting data via the withers ? In other > words is > > ```php > $uri->withQuery('?foo=bar'); > //the same as > $uri->withQuery('foo=bar'); > ``` > > I know it is the case in of the WHATWG specification but I do not know if you kept this > behaviour in your implementation for the WhatWgUrl for the Rfc3986 or for both. I would lean toward > not accepting this "normalization" but since this is not documented in the RFC I wanted to > know what is the expected behaviour. > > Yes, very good question! As you said, this aspect is not defined by either the RFC 3986, or the present PHP RFC... But yes, this normalization won't be accepted by the RFC implementation. I've just included this piece of information in the relevant section ( https://wiki.php.net/rfc/url_parsing_api#component_modification). Regards, Máté

« previous php.internals (#127070) next »