[PR][php-src][#1034][master] - Change "foreach" statement behavior
| From: | noreply@php.net | Date: | Thu, 12 Feb 2015 13:03:52 +0000 |
| Subject: | [PR][php-src][#1034][master] - Change "foreach" statement behavior | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-2305@lists.php.net to get a copy of this message | ||
You can view the Pull Request on github:
https://github.com/php/php-src/pull/1034
Warning: according to github, the Pull Request cannot be merged without manual conflict resolution!
Pull Request Description:
Implementation of https://wiki.php.net/rfc/php7_foreach
- "foreach by value" don't relay on internal array/object pointer and doesn't
perform array duplication. It just locks it incrementing reference counter. If the original array is
modified by some code, the copy on write is performed and "foreach" still work with the
old copy.
- it makes no difference if array given to "foreach by value" is reference itself
- "foreach by reference" still use internal array/object pointer and should work similar
to PHP-5 except for few inconsistent cases.