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/

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to