On 01/12/2024 03:41, mickmackusa wrote:
[image: image.png]


Please avoid images of text; most of the reasons it's a bad idea on Stack Overflow apply here https://meta.stackoverflow.com/q/285551/157957 plus a lot of mailing list archives and e-mail readers will not show HTML formatting at all, e.g. https://externals.io/message/126085

I had to read several replies to actually see what issue you were discussing.


On 01/12/2024 23:50, mickmackusa wrote:
I can appreciate that.  Going forward, is there any benefit to preserving the behavior of returning integers beyond -1, 0, and 1? Should these topically related functions receive a new last argument? bool $distance = false


The functions are not attempting to return a meaningful "distance", this is just an optimisation: the intended use case is as a callback to functions like usort() which only care about <0, 0, >0, so no CPU time is spent normalising the result to specific values.

The documentation is simply mistaken in saying "-1" instead of "a value less than zero" and "1" instead of "a value more than zero".

Regards,

--
Rowan Tommins
[IMSoP]

Reply via email to