A bit off topic, but not entirely: In my opinion, adding another flag isn't the _real_ fix. Any function which does comparisons should take a callable for users to provide any comparison they wish. An iteratively better API would be:
function array_unique<T>(list<T> $array, callable(T $a, T $b): int $comparator); Of course, there are other things like instead of using int for `0`, `-1`, `1`, we could have used an enum but we don't have one today. I just mean the core idea of taking callable is better than mucking around with flags while also allowing for custom comparison. Note that it doesn't necessarily prevent optimizations either. For instance, if they had passed `php_compare` or some function which represents `$a <=> $b`, we could identify that just as we identify a specific flag and take an optimized pass. Note that as enums aren't "comparable" directly, we could have provided a custom comparator in this case, no "fix" necessary in core. ---- Of course, this complaining doesn't fix the situation we are in. My first impression is that might be better to provide one or more alternative functions and to deprecate `array_unique`. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php