Unwrap reference after foreach
| From: | Nikita Popov | Date: | Fri, 13 Aug 2021 13:28:54 +0000 |
| Subject: | Unwrap reference after foreach | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-115702@lists.php.net to get a copy of this message | ||
Hi internals,
I'd like to address a common footgun when using foreach by reference:
https://wiki.php.net/rfc/foreach_unwrap_ref
This addresses the issue described in the big red box at
https://www.php.net/manual/en/control-structures.foreach.php.
While this is
"not a bug" (as our bug tracker can regularly attest), it's rather
unexpected, and we could easily avoid it...
Regards,
Nikita