cvs: phpdoc /en/language control-structures.xml
| From: | Etienne Kneuss | Date: | Sat, 10 Nov 2007 16:57:24 +0000 |
| Subject: | cvs: phpdoc /en/language control-structures.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-368@lists.php.net to get a copy of this message | ||
colder Sat Nov 10 16:57:24 2007 UTC
Modified files:
/phpdoc/en/language control-structures.xml
Log:
Discourage using foreacha along with array pointers, "wont fix" side effects
http://cvs.php.net/viewvc.cgi/phpdoc/en/language/control-structures.xml?r1=1.150&r2=1.151&diff_format=u
Index: phpdoc/en/language/control-structures.xml
diff -u phpdoc/en/language/control-structures.xml:1.150
phpdoc/en/language/control-structures.xml:1.151
--- phpdoc/en/language/control-structures.xml:1.150 Sun Oct 14 02:51:28 2007
+++ phpdoc/en/language/control-structures.xml Sat Nov 10 16:57:24 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.150 $ -->
+<!-- $Revision: 1.151 $ -->
<chapter xml:id="language.control-structures" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Control Structures</title>
@@ -540,15 +540,9 @@
<para>
Unless the array is <link
linkend="language.references">referenced</link>,
<literal>foreach</literal> operates on a copy of
- the specified array and not the array itself. Therefore, the
- array pointer is not modified as with the
- <function>each</function> construct, and changes to the array
- element returned are not reflected in the original array.
- However, the internal pointer of the original array
- <emphasis>is</emphasis> advanced with the processing of the
- array. Assuming the foreach loop runs to completion, the
- array's internal pointer will be at the end of the array.
- </para>
+ the specified array and not the array itself.<literal>foreach</literal> has
+ some side effets on the array pointer. Don't rely on the array pointer during
+ or after the foreach without resetting it.</para>
</note>
</para>
<para>