mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-31 04:27:00 +00:00
Document that reusing a non-rewindable iterator after destructuring is unsupported
This commit is contained in:
@@ -1220,6 +1220,11 @@ 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.
|
||||
|
||||
Do not reuse a non-rewindable iterator (like a generator) after destructuring
|
||||
it: Twig does not define the iteration state it is left in. A rewindable
|
||||
iterator can be traversed again afterwards and restarts from the beginning,
|
||||
according to its own behavior.
|
||||
|
||||
Object Destructuring
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
Reference in New Issue
Block a user