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

From: Date: Mon, 28 Apr 2025 21:20:57 +0000
Subject: Re: [RFC] [Discussion] Add WHATWG compliant URL parsing API
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hi Ignace,

The $excludeFragment is true by default so in the example it should be
> false instead. Perhaps using an Enum instead would make the
> DX easier than using a boolean ?
> I believe the same issue is in all examples regarding the use of that
> parameter.
>

You are right, I completely messed up the value of the $excludeFragment
variables in the examples. After having thought about your suggestion, I'm
fine with adding the enum.
It's a bit verbose indeed, but at least it properly conveys the meaning of
the parameter, so hopefully it will reduce the number of WTFs when people
start to use the new API. :)

I fiddled a little bit with the implementation, and I went with the
Uri\UriComparisonMode enum name at last. I hope that it is OK on your side.

Regards,
Máté


Thread (152 messages)

« previous php.internals (#127232) next »