Doc #67005 [Opn->Ana]: foreach documentation incomplete?
| From: | dm@php.net | Date: | Wed, 16 Apr 2014 00:09:19 +0000 |
| Subject: | Doc #67005 [Opn->Ana]: foreach documentation incomplete? | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-11153@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=67005&edit=1
ID: 67005
Updated by: dm@php.net
Reported by: afhole at gmail dot com
Summary: foreach documentation incomplete?
-Status: Open
+Status: Analyzed
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2014-04-16 00:08:29] dm@php.net
It is highly likely that Serbian documentation hasn't been updated for a while. The behavior
you're describing is the "default" and is valid. To learn more about how foreach
works, consult this answer by nikic@php.net: http://stackoverflow.com/a/14854568/424004
We will update the English documentation if it's missing some key notes.
------------------------------------------------------------------------
[2014-04-02 09:58:55] afhole at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/control-structures.foreach
---
The following note is missing from the EN docs:
"Unless the array is referenced, foreach operates on a copy of the specified array and not the
array itself. foreach has some side effects on the array pointer. Don't rely on the array
pointer during or after the foreach without resetting it."
Yet it is present on the Serbian docs: http://php.net/manual/sr/control-structures.foreach.php
Is this still the behaviour of foreach? It seems to be.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67005&edit=1