Allow array_diff() and array_intersect() with single array argument Both of these functions are well-defined when used with a single array argument -- rejecting this case was an artifici
Allow array_diff() and array_intersect() with single array argument Both of these functions are well-defined when used with a single array argument -- rejecting this case was an artificial limitation. This is not useful when called with explicit arguments, but removes edge-cases when used with argument unpacking: // OK even if $excludes is empty. array_diff($array, ...$excludes); // OK even if $arrays contains a single array only. array_intersect(...$arrays); This matches the behavior of functions like array_merge() and array_push(), which also allow calls with no array or a single array respectively. Closes GH-6097.
show more ...
|