reference/array/functions/next.xml
2e60c5134e7a847c99f81eb3f7ecee1f5efeeace
...
...
@@ -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>
...
...
@@ -54,11 +71,11 @@
54
71
<![CDATA[
55
72
<?php
56
73
$transport = array('foot', 'bike', 'car', 'plane');
57
-
$mode = current($transport); // $mode = 'foot';
58
-
$mode = next($transport); // $mode = 'bike';
59
-
$mode = next($transport); // $mode = 'car';
60
-
$mode = prev($transport); // $mode = 'bike';
61
-
$mode = end($transport); // $mode = 'plane';
74
+
echo $mode = current($transport), PHP_EOL; // $mode = 'foot';
75
+
echo $mode = next($transport), PHP_EOL; // $mode = 'bike';
76
+
echo $mode = next($transport), PHP_EOL; // $mode = 'car';
77
+
echo $mode = prev($transport), PHP_EOL; // $mode = 'bike';
78
+
echo $mode = end($transport), PHP_EOL; // $mode = 'plane';
62
79
?>
63
80
]]>
64
81
</programlisting>
...
...
@@ -72,7 +89,7 @@ $mode = end($transport); // $mode = 'plane';
72
89
<simpara>
73
90
The end of an array is indistinguishable from a <type>bool</type> &false; element.
74
91
To properly traverse an array which may contain &false; elements, see the
75
-
<function>foreach</function> function.
92
+
<link linkend="control-structures.foreach"><literal>foreach</literal></link> function.
76
93
</simpara>
77
94
<simpara>
78
95
To still use <function>next</function> and properly check if the end of the array
79
96