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

From: Date: Thu, 04 Aug 2011 17:56:00 +0000
Subject: svn: /phpdoc/es/trunk/language/control-structures/ foreach.xml
Groups: php.doc.es 
Request: Send a blank email to doc-es+get-4672@lists.php.net to get a copy of this message
jpberdejo Thu, 04 Aug 2011 17:56:00 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=314291 Log: English version update Changed paths: U phpdoc/es/trunk/language/control-structures/foreach.xml Modified: phpdoc/es/trunk/language/control-structures/foreach.xml =================================================================== --- phpdoc/es/trunk/language/control-structures/foreach.xml 2011-08-04 15:47:38 UTC (rev 314290) +++ phpdoc/es/trunk/language/control-structures/foreach.xml 2011-08-04 17:56:00 UTC (rev 314291) @@ -1,14 +1,13 @@ <?xml version="1.0" encoding="utf-8"?> <!-- $Revision$ --> -<!-- EN-Revision: 312947 Maintainer: jpberdejo Status: ready --> +<!-- EN-Revision: 313749 Maintainer: jpberdejo Status: ready --> <sect1 xml:id="control-structures.foreach" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <title><literal>foreach</literal></title> <?phpdoc print-version-for="foreach"?> <para> - PHP 4 introdujo un constructor <literal>foreach</literal>, muy - parecido al de Perl y algunos otros lenguajes. Simplemente da un modo fácil de - iterar sobre arrays. <literal>foreach</literal> sólo trabaja sobre arrays y + El constructor <literal>foreach</literal> simplemente da un modo fácil de + iterar sobre arrays. <literal>foreach</literal> funciona solo sobre arrays (y objetos) y resultará en un error al intentar usarlo en una variable con un diferente tipo de datos o una variable no inicializada. Hay dos sintaxis; la segunda es una extensión menor, pero útil de la primera: @@ -37,8 +36,8 @@ <literal>$key</literal> en cada ciclo. </simpara> <simpara> - A partir de PHP 5, es posible - <link linkend="language.oop5.iterations">iterar objetos</link> también. + A partir de PHP 5, también es posible + <link linkend="language.oop5.iterations">personalizar los objetos de la iteración</link>. </simpara> <para> <note> @@ -83,6 +82,7 @@ </informalexample> Esto sólo es posible si el array iterado puede ser referenciado (es decir, es una variable), lo que significa que el código siguiente no funciona: + <informalexample> <programlisting role="php"> <![CDATA[ <?php @@ -93,6 +93,7 @@ ?> ]]> </programlisting> + </informalexample> </para> <warning> <para> @@ -211,7 +212,6 @@ </para> </sect1> - <!-- Keep this comment at the end of the file Local variables: mode: sgml

« previous php.doc.es (#4672) next »