I'm not too sure how interesting this article is gonna be, but for the last coupla days I've been trying to solve a problem using
array_udiff()
to filter elements from one array based on their sameyness (I made that word up, sorry) compared to elements in another array. Now I know this perhaps isn't quite the intended purpose of a diffing function - and it turned out to not be a viable solution for this reason - but the investigation turned up some "interesting" behaviour that isn't clearly documented as far as I can tell.First things first, look at this shambles:
array_diff()
array_diff_assoc()
array_diff_key()
array_diff_uassoc()
array_diff_ukey()
array_udiff()
array_udiff_assoc()
array_udiff_uassoc()
array_intersect()
array_intersect_assoc()
array_intersect_key()
array_intersect_uassoc()
array_intersect_ukey()
array_uintersect()
array_uintersect_assoc()
array_uintersect_uassoc()