reference/array/functions/next.xml
9d29b382865dca44919ae9803ef5dfdcbba185fe
...
...
@@ -3,13 +3,13 @@
3
3
<refentry xml:id="function.next" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>next</refname>
6
-
<refpurpose>Advance the internal array pointer of an array</refpurpose>
6
+
<refpurpose>Advance the internal pointer of an array</refpurpose>
7
7
</refnamediv>
8
8
<refsect1 role="description">
9
9
&reftitle.description;
10
10
<methodsynopsis>
11
11
<type>mixed</type><methodname>next</methodname>
12
-
<methodparam><type>array</type><parameter role="reference">array</parameter></methodparam>
12
+
<methodparam><type class="union"><type>array</type><type>object</type></type><parameter role="reference">array</parameter></methodparam>
13
13
</methodsynopsis>
14
14
<para>
15
15
<function>next</function> behaves like
...
...
@@ -45,6 +45,23 @@
45
45
&return.falseproblem;
46
46
</refsect1>
47
47

48
+
<refsect1 role="changelog">
49
+
&reftitle.changelog;
50
+
<informaltable>
51
+
<tgroup cols="2">
52
+
<thead>
53
+
<row>
54
+
<entry>&Version;</entry>
55
+
<entry>&Description;</entry>
56
+
</row>
57
+
</thead>
58
+
<tbody>
59
+
&standard.changelog.calling-on-objects;
60
+
</tbody>
61
+
</tgroup>
62
+
</informaltable>
63
+
</refsect1>
64
+

48
65
<refsect1 role="examples">
49
66
&reftitle.examples;
50
67
<para>
...
...
@@ -70,10 +87,13 @@ $mode = end($transport); // $mode = 'plane';
70
87
&reftitle.notes;
71
88
<note>
72
89
<simpara>
73
-
You won't be able to distinguish the end of an array from a
74
-
<type>boolean</type> &false; element. To properly traverse an array
75
-
which may contain &false; elements, see the <function>each</function>
76
-
function.
90
+
The end of an array is indistinguishable from a <type>bool</type> &false; element.
91
+
To properly traverse an array which may contain &false; elements, see the
92
+
<link linkend="control-structures.foreach"><literal>foreach</literal></link> function.
93
+
</simpara>
94
+
<simpara>
95
+
To still use <function>next</function> and properly check if the end of the array
96
+
has been reached, verify that the <function>key</function> is &null;.
77
97
</simpara>
78
98
</note>
79
99
</refsect1>
...
...
@@ -91,7 +111,6 @@ $mode = end($transport); // $mode = 'plane';
91
111
</para>
92
112
</refsect1>
93
113
</refentry>
94
-

95
114
<!-- Keep this comment at the end of the file
96
115
Local variables:
97
116
mode: sgml
98
117