Re: Draft RFC: foreach iteration of keys without values
| From: | Arvids Godjuks | Date: | Wed, 02 Sep 2020 17:04:05 +0000 |
| Subject: | Re: Draft RFC: foreach iteration of keys without values | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-111787@lists.php.net to get a copy of this message | ||
On Wed, 2 Sep 2020 at 18:58, Ben Ramsey <ben@benramsey.com> wrote:
>
> > On Sep 2, 2020, at 11:14, Lester Caine <lester@lsces.uk> wrote:
> >
> > On 02/09/2020 15:31, Thomas Bley wrote:
> >> I'd also like to propose to use null:
> >> [null, null, $username] = getUserData();
> >> foreach ($source as $key => null) {}
> >
> > Exactly what null is designed for ...
>
> I second (or third)
null.
>
> Overall, I like the proposal.
>
> Cheers,
> Ben
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: https://www.php.net/unsub.php
>
>
I second that, null fits very well and easy to understand.
The _ can be troublesome since there is _() and it can make it a bit
troublesome to implement. But regardless, I really love the null idea
personally.
--
Arvīds Godjuks
+371 26 851 664
arvids.godjuks@gmail.com
Skype: psihius
Telegram: @psihius https://t.me/psihius