svn: /phpdoc/en/trunk/language/control-structures/ foreach.xml

From: Date: Tue, 26 Jul 2011 22:20:38 +0000
Subject: svn: /phpdoc/en/trunk/language/control-structures/ foreach.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-8539@lists.php.net to get a copy of this message
vrana Tue, 26 Jul 2011 22:20:38 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=313749 Log: Foreach works on objects Changed paths: U phpdoc/en/trunk/language/control-structures/foreach.xml Modified: phpdoc/en/trunk/language/control-structures/foreach.xml =================================================================== --- phpdoc/en/trunk/language/control-structures/foreach.xml 2011-07-26 22:12:25 UTC (rev 313748) +++ phpdoc/en/trunk/language/control-structures/foreach.xml 2011-07-26 22:20:38 UTC (rev 313749) @@ -6,7 +6,7 @@ <?phpdoc print-version-for="foreach"?> <para> The <literal>foreach</literal> construct simply gives an easy way to - iterate over arrays. <literal>foreach</literal> works only on arrays, and + iterate over arrays. <literal>foreach</literal> works only on arrays (and objects), and will issue an error when you try to use it on a variable with a different data type or an uninitialized variable. There are two syntaxes; the second is a minor but useful extension of the first: @@ -35,7 +35,7 @@ </simpara> <simpara> As of PHP 5, it is possible to - <link linkend="language.oop5.iterations">iterate objects</link> too. + <link linkend="language.oop5.iterations">customize objects iteration</link> too. </simpara> <para> <note> @@ -80,6 +80,7 @@ </informalexample> This is possible only if iterated array can be referenced (i.e. is variable), that means the following code won't work: + <informalexample> <programlisting role="php"> <![CDATA[ <?php @@ -90,6 +91,7 @@ ?> ]]> </programlisting> + </informalexample> </para> <warning> <para>

« previous php.doc.cvs (#8539) next »