1
0
mirror of https://github.com/php/doc-ja.git synced 2026-03-24 07:02:08 +01:00
Files
Yoshinari Takaoka 13f97e0bb0 Removed literal tags from title for readability
Closes GH-250.


git-svn-id: https://svn.php.net/repository/phpdoc/ja/trunk@351937 c90b9560-bf6c-de11-be94-00142212c4b1
2020-12-06 23:01:25 +00:00

76 lines
2.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 7104ee97ced1768a3231588dfc0bc0d7eb1117ad Maintainer: takagi Status: ready -->
<!-- CREDITS: mumumu -->
<sect1 xml:id="control-structures.break" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>break</title>
<?phpdoc print-version-for="break"?>
<simpara>
<literal>break</literal>は、現在実行中の
<literal>for</literal>, <literal>foreach</literal>,
<literal>while</literal>, <literal>do-while</literal>,
<literal>switch</literal> 構造の実行を終了します。
</simpara>
<simpara>
<literal>break</literal> では、オプションの引数で
ネストしたループ構造を抜ける数を指定することができます。
この引数のデフォルトは <literal>1</literal> で、直近のループ構造からだけ抜けます。
</simpara>
<para>
<informalexample>
<programlisting role="php">
<![CDATA[
<?php
$arr = array('one', 'two', 'three', 'four', 'stop', 'five');
foreach ($arr as $val) {
if ($val == 'stop') {
break; /* ここでは、'break 1;'と書くこともできます */
}
echo "$val<br />\n";
}
/* オプション引数を使用します */
$i = 0;
while (++$i) {
switch ($i) {
case 5:
echo "At 5<br />\n";
break 1; /* switch 構造のみを抜けます */
case 10:
echo "At 10; quitting<br />\n";
break 2; /* switch と while を抜けます */
default:
break;
}
}
?>
]]>
</programlisting>
</informalexample>
</para>
</sect1>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->