mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-31 12:37:15 +00:00
Document that sequence destructuring consumes one value per pattern slot
This commit is contained in:
+3
-2
@@ -1216,8 +1216,9 @@ You can skip values by leaving a slot empty:
|
||||
|
||||
Sequence destructuring also works with iterators (any ``Traversable``
|
||||
value). Values are extracted in iteration order and keys are ignored. The
|
||||
iterator is consumed lazily: only as many values as there are variables are
|
||||
fetched, and the expression returns the iterator itself.
|
||||
iterator is consumed lazily: only as many values as there are slots in the
|
||||
pattern are fetched (an empty slot consumes a value too), and the expression
|
||||
returns the iterator itself.
|
||||
|
||||
Object Destructuring
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Reference in New Issue
Block a user