-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
Add destructuring assignment syntax that makes it possible to unpack values from arrays, or properties from objects, into distinct variables (as same is in Javascript):
A twig template
{% set [a, b] = [1, 2] %}
{% for {id, firstName, ...rest} in data %}
{% endfor %}should be converted to
[$a, $b] = [1, 2];
foreach ($data as ['id' => $id, 'firstName' => $firstName]) {
// TODO support for ...rest
}Reactions are currently unavailable