language/control-structures/break.xml
7104ee97ced1768a3231588dfc0bc0d7eb1117ad
...
...
@@ -2,7 +2,7 @@
2
2
<!-- $Revision$ -->
3
3

4
4
<sect1 xml:id="control-structures.break" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5
-
<title><literal>break</literal></title>
5
+
<title>break</title>
6
6
<?phpdoc print-version-for="break"?>
7
7
<simpara>
8
8
<literal>break</literal> ends execution of the current
...
...
@@ -22,7 +22,7 @@
22
22
<![CDATA[
23
23
<?php
24
24
$arr = array('one', 'two', 'three', 'four', 'stop', 'five');
25
-
while (list(, $val) = each($arr)) {
25
+
foreach ($arr as $val) {
26
26
if ($val == 'stop') {
27
27
break; /* You could also write 'break 1;' here. */
28
28
}
...
...
@@ -34,14 +34,14 @@ while (list(, $val) = each($arr)) {
34
34
$i = 0;
35
35
while (++$i) {
36
36
switch ($i) {
37
-
case 5:
38
-
echo "At 5<br />\n";
39
-
break 1; /* Exit only the switch. */
40
-
case 10:
41
-
echo "At 10; quitting<br />\n";
42
-
break 2; /* Exit the switch and the while. */
43
-
default:
44
-
break;
37
+
case 5:
38
+
echo "At 5<br />\n";
39
+
break 1; /* Exit only the switch. */
40
+
case 10:
41
+
echo "At 10; quitting<br />\n";
42
+
break 2; /* Exit the switch and the while. */
43
+
default:
44
+
break;
45
45
}
46
46
}
47
47
?>
...
...
@@ -49,35 +49,7 @@ while (++$i) {
49
49
</programlisting>
50
50
</informalexample>
51
51
</para>
52
-
<para>
53
-
<table>
54
-
<title>Changelog for <literal>break</literal></title>
55
-
<tgroup cols="2">
56
-
<thead>
57
-
<row>
58
-
<entry>&Version;</entry>
59
-
<entry>&Description;</entry>
60
-
</row>
61
-
</thead>
62
-
<tbody>
63
-
<row>
64
-
<entry>5.4.0</entry>
65
-
<entry>
66
-
<literal>break 0;</literal> is no longer valid. In previous versions it was interpreted
67
-
the same as <literal>break 1;</literal>.
68
-
</entry>
69
-
</row>
70
-
<row>
71
-
<entry>5.4.0</entry>
72
-
<entry>
73
-
Removed the ability to pass in variables (e.g., <literal>$num = 2; break $num;</literal>)
74
-
as the numerical argument.
75
-
</entry>
76
-
</row>
77
-
</tbody>
78
-
</tgroup>
79
-
</table>
80
-
</para>
52
+

81
53
</sect1>
82
54

83
55
<!-- Keep this comment at the end of the file
84
56