rfc:foreach_unwrap_ref
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Last revisionBoth sides next revision | ||
rfc:foreach_unwrap_ref [2021/08/26 13:44] – nikic | rfc:foreach_unwrap_ref [2021/08/26 14:23] – nikic | ||
---|---|---|---|
Line 98: | Line 98: | ||
Use of complex variables as foreach targets is very unusual, so it is rather unlikely that someone will encounter issues with the reused loop variables in this context. Always performing the unwrap would certainly be possible, but the cure seems worse than disease in this instance. | Use of complex variables as foreach targets is very unusual, so it is rather unlikely that someone will encounter issues with the reused loop variables in this context. Always performing the unwrap would certainly be possible, but the cure seems worse than disease in this instance. | ||
+ | |||
+ | When foreach is used in conjunction with destructuring, | ||
+ | |||
+ | <PHP> | ||
+ | foreach ($array as [&$var, & | ||
+ | </ | ||
+ | |||
+ | In this example, '' | ||
===== Backward Incompatible Changes ===== | ===== Backward Incompatible Changes ===== |
rfc/foreach_unwrap_ref.txt · Last modified: 2021/11/14 17:10 by nikic