Document that a semicolon also may be used after a case, like: case 1; case 2;, ...

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@265141 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Kalle Sommer Nielsen 2008-08-19 23:12:48 +00:00
parent 3e99f84597
commit ec9fc2e0f7

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.163 $ -->
<!-- $Revision: 1.164 $ -->
<chapter xml:id="language.control-structures" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Control Structures</title>
@ -1070,6 +1070,28 @@ default:
echo "i is not equal to 0, 1 or 2";
endswitch;
?>
]]>
</programlisting>
</informalexample>
</para>
<para>
Its possible to use a semicolon insted of a colon after a case like:
<informalexample>
<programlisting role="php">
<![CDATA[
<?php
switch($beer)
{
case 'tuborg';
case 'carlsberg';
case 'heineken';
echo 'Good choice';
break;
default;
echo 'Please make a new selection...';
break;
}
?>
]]>
</programlisting>
</informalexample>