On Sun, Nov 12, 2023 at 8:20 PM Andreas Hennings <andr...@dqxtech.net>
wrote:

> So to me, this alone is an argument to implement this natively.
> The other argument is that it is kind of sad how the current functions
> don't behave as one would expect.


I'd expect there to be a larger and proportionately increasing performance
difference between array_diff versus array_udiff with callback or a
userland array_diff_strict function the larger the datasets you feed in.
But I'm not sure how common either the use case of diffing arrays of 25,000
or 250,000 elements might be, or needing this comparison to be strict
equality. I suspect the use case where both these conditions apply is very
rare.

But if you want to create an RFC, please go for it. You could add an extra
parameter to these functions after the input arrays, which was a flag for
strict comparison. Whether such a thing with a default value of non-strict
(so not BC breaking) would be considered preferable to new global
functions, I'm not sure. I'd probably go with new functions but maybe
someone else will weigh in with their thoughts.

Reply via email to