reference/array/functions/array-pad.xml
2ed209827b7652deaf6d37293938a91196dcd91a
...
...
@@ -1,6 +1,6 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.array-pad">
3
+
<refentry xml:id="function.array-pad" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>array_pad</refname>
6
6
<refpurpose>Pad array to the specified length with a value</refpurpose>
...
...
@@ -11,20 +11,19 @@
11
11
<methodsynopsis>
12
12
<type>array</type><methodname>array_pad</methodname>
13
13
<methodparam><type>array</type><parameter>array</parameter></methodparam>
14
-
<methodparam><type>int</type><parameter>size</parameter></methodparam>
14
+
<methodparam><type>int</type><parameter>length</parameter></methodparam>
15
15
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
16
16
</methodsynopsis>
17
17
<para>
18
18
<function>array_pad</function> returns a copy of the
19
19
<parameter>array</parameter> padded to size specified by
20
-
<parameter>size</parameter> with value
20
+
<parameter>length</parameter> with value
21
21
<parameter>value</parameter>. If
22
-
<parameter>size</parameter> is positive then the array is
22
+
<parameter>length</parameter> is positive then the array is
23
23
padded on the right, if it's negative then on the left. If the
24
-
absolute value of <parameter>size</parameter> is less than or
24
+
absolute value of <parameter>length</parameter> is less than or
25
25
equal to the length of the <parameter>array</parameter> then no
26
26
padding takes place.
27
-
It is possible to add at most 1048576 elements at a time.
28
27
</para>
29
28
</refsect1>
30
29

...
...
@@ -41,7 +40,7 @@
41
40
</listitem>
42
41
</varlistentry>
43
42
<varlistentry>
44
-
<term><parameter>size</parameter></term>
43
+
<term><parameter>length</parameter></term>
45
44
<listitem>
46
45
<para>
47
46
New size of the array.
...
...
@@ -53,7 +52,7 @@
53
52
<listitem>
54
53
<para>
55
54
Value to pad if <parameter>array</parameter> is less than
56
-
<parameter>size</parameter>.
55
+
<parameter>length</parameter>.
57
56
</para>
58
57
</listitem>
59
58
</varlistentry>
...
...
@@ -65,15 +64,40 @@
65
64
&reftitle.returnvalues;
66
65
<para>
67
66
Returns a copy of the <parameter>array</parameter> padded to size specified
68
-
by <parameter>size</parameter> with value
69
-
<parameter>value</parameter>. If <parameter>size</parameter> is
67
+
by <parameter>length</parameter> with value
68
+
<parameter>value</parameter>. If <parameter>length</parameter> is
70
69
positive then the array is padded on the right, if it's negative then
71
-
on the left. If the absolute value of <parameter>size</parameter> is less
70
+
on the left. If the absolute value of <parameter>length</parameter> is less
72
71
than or equal to the length of the <parameter>array</parameter> then no
73
72
padding takes place.
74
73
</para>
75
74
</refsect1>
76
75

76
+
<refsect1 role="changelog">
77
+
&reftitle.changelog;
78
+
<para>
79
+
<informaltable>
80
+
<tgroup cols="2">
81
+
<thead>
82
+
<row>
83
+
<entry>&Version;</entry>
84
+
<entry>&Description;</entry>
85
+
</row>
86
+
</thead>
87
+
<tbody>
88
+
<row>
89
+
<entry>8.3.0</entry>
90
+
<entry>
91
+
Prior to 8.3, only 1048576 elements could be added at once.
92
+
Now it is limited only by the maximum size of an array instead.
93
+
</entry>
94
+
</row>
95
+
</tbody>
96
+
</tgroup>
97
+
</informaltable>
98
+
</para>
99
+
</refsect1>
100
+

77
101
<refsect1 role="examples">
78
102
&reftitle.examples;
79
103
<para>
...
...
@@ -108,7 +132,6 @@ $result = array_pad($input, 2, "noop");
108
132
</para>
109
133
</refsect1>
110
134
</refentry>
111
-

112
135
<!-- Keep this comment at the end of the file
113
136
Local variables:
114
137
mode: sgml
115
138