Re: Argument unpacking - Multiple unpacks and trailing arguments
| From: | Lars Strojny | Date: | Mon, 23 Sep 2013 19:37:26 +0000 |
| Subject: | Re: Argument unpacking - Multiple unpacks and trailing arguments | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-69294@lists.php.net to get a copy of this message | ||
Hi Nikita,
Am 23.09.2013 um 21:33 schrieb Nikita Popov <nikita.ppv@gmail.com>:
[...]
> An example of trailing arguments are array intersections and diffs using a
> custom compare function:
>
> array_uintersect(...$arrays, $compare);
> array_udiff(...$arrays, $compare);
> // also array_intersect_uassoc and all those other variations on the
> topic
>
> Some people expressed concern about allow both usages (multiple unpacks /
> trailing args). I have a bit of a hard time understanding this (as there
> clearly are practical applications for both), so I'd appreciate some more
> opinions on the topic.
Although it might allow users to shoot into their foot, I prefer having it instead of introducing a
limitation that is not technically necessary. So +1
cu,
Lars
Attachment: [application/pgp-signature] Message signed with OpenPGP using GPGMail signature.asc
Attachment: [application/pgp-signature] Message signed with OpenPGP using GPGMail signature.asc