Date: 06/30/00
- Next message: Rui Hirokawa: "[PHP-DOC] cvs: phpdoc /en/functions mail.xml /ja bookinfo.xml /ja/functions imap.xml info.xml mail.xml misc.xml pcre.xml strings.xml"
- Previous message: Daniel Beckham: "[PHP-DOC] cvs: phpdoc /en/functions array.xml"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
sterling Fri Jun 30 17:23:04 2000 EDT
Modified files:
/phpdoc/en/language control-structures.xml
Log:
Add note about foreach operating on a copy of the array, not the array itself.
Index: phpdoc/en/language/control-structures.xml
diff -u phpdoc/en/language/control-structures.xml:1.9 phpdoc/en/language/control-structures.xml:1.10
--- phpdoc/en/language/control-structures.xml:1.9 Thu Apr 13 12:49:05 2000
+++ phpdoc/en/language/control-structures.xml Fri Jun 30 17:23:04 2000
@@ -457,13 +457,26 @@
element's key will be assigned to the variable
<literal>$key</literal> on each loop.
</simpara>
- <simpara>
- When <literal>foreach</literal> first starts executing, the
- internal array pointer is automatically reset to the first element
- of the array. This means that you do not need to call
- <function>reset</function> before a <literal>foreach</literal>
- loop.
- </simpara>
+ <para>
+ <note>
+ <para>
+ When <literal>foreach</literal> first starts executing, the
+ internal array pointer is automatically reset to the first element
+ of the array. This means that you do not need to call
+ <function>reset</function> before a <literal>foreach</literal>
+ loop.
+ </para>
+ </note>
+ </para>
+ <para>
+ <note>
+ <para>
+ Also note that <literal>foreach</literal> operates on a copy of
+ the specified array, not the array itself, therefore the array
+ pointer is not modified like with the each construct.
+ </para>
+ </note>
+ </para>
<para>
You may have noticed that the following are functionally
identical:
- Next message: Rui Hirokawa: "[PHP-DOC] cvs: phpdoc /en/functions mail.xml /ja bookinfo.xml /ja/functions imap.xml info.xml mail.xml misc.xml pcre.xml strings.xml"
- Previous message: Daniel Beckham: "[PHP-DOC] cvs: phpdoc /en/functions array.xml"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

