> Hi Máté > > Something that I thought about lately is how the existing URL parser in PHP is used in various different places. > So for example, in the http fopen wrapper or in the filter extension we rely on the built-in URL parser. > I think it would be beneficial if a URL parser was "pluggable" and the url extension could be used instead of the current one for those usages (opt-in). > > Kind regards > Niels
Hi Niels, As mentioned before, I believe the "pluggable" system can only be applied once a RFC3986 URL object is available, using the WHATWG URL would constitute a major BC. I would even go a step further and state that even by using the RFC3986 URL object you would still face some issues, for instance, in regards to `file` scheme based URL. Those are not parsed the same way with `parse_url` function and RFC3986 rules. Maybe that change may land on PHP9 or the behaviour may be deprecated to be removed in PHP10 whenever that one happens. On Sun, Jul 21, 2024 at 1:22 PM Niels Dossche <dossche.ni...@gmail.com> wrote: > On 28/06/2024 22:06, Máté Kocsis wrote: > > Hi Everyone, > > > > I've been working on a new RFC for a while now, and time has come to > present it to a wider audience. > > > > Last year, I learnt that PHP doesn't have built-in support for parsing > URLs according to any well established standards (RFC 1738 or the WHATWG > URL living standard), since the parse_url() function is optimized for > performance instead of correctness. > > > > In order to improve compatibility with external tools consuming URLs > (like browsers), my new RFC would add a WHATWG compliant URL parser > functionality to the standard library. The API itself is not final by any > means, the RFC only represents how I imagined it first. > > > > You can find the RFC at the following link: > https://wiki.php.net/rfc/url_parsing_api < > https://wiki.php.net/rfc/url_parsing_api> > > > > Regards, > > Máté > > > > Hi Máté > > Something that I thought about lately is how the existing URL parser in > PHP is used in various different places. > So for example, in the http fopen wrapper or in the filter extension we > rely on the built-in URL parser. > I think it would be beneficial if a URL parser was "pluggable" and the url > extension could be used instead of the current one for those usages > (opt-in). > > Kind regards > Niels >