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

From: Date: Mon, 13 Jun 2016 12:06:55 +0000
Subject: svn: /phpdoc/en/trunk/language/control-structures/ foreach.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-14181@lists.php.net to get a copy of this message
cmb Mon, 13 Jun 2016 12:06:55 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=339330 Log: The manual is supposed to cover all PHP 5 versions Therefore we restore the recently removed (339323) part, mark it as being version specific, and add a general changelog. 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 2016-06-13 11:42:41 UTC (rev 339329) +++ phpdoc/en/trunk/language/control-structures/foreach.xml 2016-06-13 12:06:55 UTC (rev 339330) @@ -110,6 +110,21 @@ </informalexample> </warning> <para> + Before PHP 5.5.0, referencing <literal>$value</literal> is only possible if the iterated array can be + referenced (i.e. if it is a variable). The following code works only as of PHP 5.5.0: + <informalexample> + <programlisting role="php"> +<![CDATA[ +<?php +foreach (array(1, 2, 3, 4) as &$value) { + $value = $value * 2; +} +?> +]]> + </programlisting> + </informalexample> + </para> + <para> <note> <para> <literal>foreach</literal> does not support the ability to @@ -324,6 +339,44 @@ </informalexample> </para> </sect2> + + <sect2 role="changelog"> + &reftitle.changelog; + <para> + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>7.0.0</entry> + <entry> + <literal>foreach</literal> does not use the internal array pointer anymore. + </entry> + </row> + <row> + <entry>5.5.0</entry> + <entry> + Referencing of <literal>$value</literal> is supported for expressions. + Formerly, only variables have been supported. + </entry> + </row> + <row> + <entry>5.5.0</entry> + <entry> + Unpacking nested arrays with <function>list</function> is supported. + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </sect2> + </sect1> <!-- Keep this comment at the end of the file

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