Hello internals, I noticed that array functions like array_diff(), array_intersect() etc use weak comparison.
E.g. array_diff([0, '', false, null], [null]) only leaves [0]. This makes these functions useless for a number of applications. Also it can lead to unpleasant surprises, if a developer is not aware of the silent type casting. For BC reasons. the existing functions have to remain as they are. Also, most of them don't really have a place for an extra parameter to tell them to use strict comparison. So, as a solution, we would have to introduce new functions. Has anything like this been proposed in the past? How would we name the new functions? Should they be functions or static methods like StrictArray::diff(..)? I could post an RFC but I want to get some feedback first. Kind regards Andreas -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php