[PHP-DOC] cvs: phpdoc /en/language control-structures.xml From: Sterling Hughes (stirling <email protected>)
Date: 06/30/00

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: