Re: [VOTE]Call for voting: support use list in foreach
| From: | Laruence | Date: | Sat, 25 Aug 2012 12:33:50 +0000 |
| Subject: | Re: [VOTE]Call for voting: support use list in foreach | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-62480@lists.php.net to get a copy of this message | ||
Hi:
Voting closed.
Result:
foreach supports list syntax: 11 for yes, 4 for no. accepted.
foreach supports list with silent token: 2 for yes, 10 for no. denied.
thanks for your great advise.
I will commit the patch later.
thanks
On Sat, Aug 18, 2012 at 12:34 PM, Laruence <laruence@php.net> wrote:
> Hi:
> This feature introduces list() support in foreach constructs(more
> info can be found here: https://wiki.php.net/rfc/foreachlist).
>
> this could make the grammar more consistent, see following example:
>
> <?php
> $users = array(
> array('Foo', 'Bar'),
> array('Baz', 'Qux');
> );
>
> // Before
> foreach ($users as $user) {
> list($firstName, $lastName) = $user;
> echo "First name: $firstName, last name: $lastName. ";
> }
>
> // After
> foreach ($users as list($firstName, $lastName)) {
> echo "First name: $firstName, last name: $lastName. ";
> }
> ?>
>
> previous discussion could be found at :
> http://marc.info/?l=php-internals&m=134277050215818&w=2
>
> please vote for this:
> https://wiki.php.net/rfc/foreachlist#vote
>
> thanks :)
>
> --
> Laruence Xinchen Hui
> http://www.laruence.com/
--
Laruence Xinchen Hui
http://www.laruence.com/