hirokawa Sat Jun 14 00:00:55 2003 EDT Modified files: /phpdoc/en/language types.xml Log: added note to explain unset() doesn't change maximum index value. Index: phpdoc/en/language/types.xml diff -u phpdoc/en/language/types.xml:1.114 phpdoc/en/language/types.xml:1.115 --- phpdoc/en/language/types.xml:1.114 Sun Jun 8 07:48:58 2003 +++ phpdoc/en/language/types.xml Sat Jun 14 00:00:55 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.114 $ --> +<!-- $Revision: 1.115 $ --> <chapter id="language.types"> <title>Types</title> @@ -1391,6 +1391,26 @@ </programlisting> </informalexample> </para> + <note> + <para> + If you omit a key, the maximum of the integer-indices is taken, and + the new key will be that maximum + 1. + Note that the maximum is same when the element having + maximum-index was cleared using <function>unset</function> function. + <informalexample> + <programlisting role="php"> +<![CDATA[ +<?php +$a = array("orange","apple","banana"); +unset($a[2]); // clear $a[2] +$a[] = 'carrot'; // assign a new value without key +var_dump($a); // output: array(0 => 'orange', 1 => 'apple', 3 => 'carrot') +?> +]]> + </programlisting> + </informalexample> + </para> + </note> </sect3> </sect2><!-- end syntax -->
-- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php