svn: /phpdoc/en/trunk/reference/array/functions/ array-fill.xml
| From: | Peter Cowburn | Date: | Sat, 30 Apr 2011 11:46:19 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/array/functions/ array-fill.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-8043@lists.php.net to get a copy of this message | ||
salathe Sat, 30 Apr 2011 11:46:19 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=310656
Log:
clarify parameter descriptions for array_fill() (doc #54628)
Bug: http://bugs.php.net/54628 (Open) for array_fill,
description of parameter start_index appears incorrect.
Changed paths:
U phpdoc/en/trunk/reference/array/functions/array-fill.xml
Modified: phpdoc/en/trunk/reference/array/functions/array-fill.xml
===================================================================
--- phpdoc/en/trunk/reference/array/functions/array-fill.xml 2011-04-29 13:49:56 UTC (rev 310655)
+++ phpdoc/en/trunk/reference/array/functions/array-fill.xml 2011-04-30 11:46:19 UTC (rev 310656)
@@ -32,8 +32,14 @@
<listitem>
<para>
The first index of the returned array.
- Supports non-negative indexes only.
</para>
+ <para>
+ If <parameter>start_index</parameter> is negative,
+ the first index of the returned array will be
+ <parameter>start_index</parameter> and the following
+ indices will start from zero
+ (see <link
linkend="function.array-fill.example.basic">example</link>).
+ </para>
</listitem>
</varlistentry>
@@ -41,7 +47,8 @@
<term><parameter>num</parameter></term>
<listitem>
<para>
- Number of elements to insert
+ Number of elements to insert.
+ Must be greater than zero.
</para>
</listitem>
</varlistentry>
@@ -77,13 +84,13 @@
<refsect1 role="examples">
&reftitle.examples;
<para>
- <example>
+ <example xml:id="function.array-fill.example.basic">
<title><function>array_fill</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$a = array_fill(5, 6, 'banana');
-$b = array_fill(-2, 2, 'pear');
+$b = array_fill(-2, 4, 'pear');
print_r($a);
print_r($b);
?>
@@ -105,6 +112,8 @@
(
[-2] => pear
[0] => pear
+ [1] => pear
+ [2] => pear
)
]]>
</screen>