Skip to content

Commit cb46cdd

Browse files
committed
[control-structures] sync with en.
1 parent a25f9b6 commit cb46cdd

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

language/control-structures/match.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 6c71b05df89358d7760a4740ed3fcfa1682eadb6 Maintainer: mumumu Status: ready -->
3+
<!-- EN-Revision: 17502ebe0691a84e7d0738c13e8c1061dde98de7 Maintainer: mumumu Status: ready -->
44

55
<sect1 xml:id="control-structures.match" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
66
<title>match</title>
@@ -66,8 +66,8 @@ $output = match (true) {
6666
$age < 2 => "Baby",
6767
$age < 13 => "Child",
6868
$age <= 19 => "Teenager",
69+
$age >= 40 => "Old adult",
6970
$age > 19 => "Young adult",
70-
$age >= 40 => "Old adult"
7171
};
7272
7373
var_dump($output);
@@ -89,7 +89,7 @@ string(8) "Teenager"
8989
</note>
9090
<note>
9191
<simpara>
92-
<literal>match</literal> 式は、必ずセミコロン <literal>;</literal> で終わらなければなりません。
92+
<literal>match</literal> 式を単一の式として使う場合は、必ずセミコロン <literal>;</literal> で終わらなければなりません。
9393
</simpara>
9494
</note>
9595
</example>
@@ -137,8 +137,8 @@ string(8) "Teenager"
137137
<![CDATA[
138138
<?php
139139
$result = match ($x) {
140-
foo() => ...,
141-
$this->bar() => ..., // foo() === $x であれば $this->bar() は呼び出されません
140+
foo() => 'value',
141+
$this->bar() => 'value', // foo() === $x であれば $this->bar() は呼び出されません
142142
$this->baz => beep(), // $x === $this->baz でなければ beep() は呼び出されません。
143143
// などなど
144144
};
@@ -287,8 +287,8 @@ string(11) "young adult"
287287
$text = 'Bienvenue chez nous';
288288
289289
$result = match (true) {
290-
str_contains($text, 'Welcome') || str_contains($text, 'Hello') => 'en',
291-
str_contains($text, 'Bienvenue') || str_contains($text, 'Bonjour') => 'fr',
290+
str_contains($text, 'Welcome'), str_contains($text, 'Hello') => 'en',
291+
str_contains($text, 'Bienvenue'), str_contains($text, 'Bonjour') => 'fr',
292292
// ...
293293
};
294294

language/control-structures/require.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 84b8fca68fc762fefe85acde180a38b2e77a28b9 Maintainer: takagi Status: ready -->
3+
<!-- EN-Revision: 30c0106d51ac2786b81b27709ca88f1daf07e716 Maintainer: takagi Status: ready -->
44

55
<sect1 xml:id="function.require" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
66
<title>require</title>
77
<?phpdoc print-version-for="require"?>
88

99
<para>
1010
<literal>require</literal> は <function>include</function>
11-
とほぼ同じですが、失敗した場合に <constant>E_COMPILE_ERROR</constant>
12-
レベルの致命的なエラーも発生するという点が異なります。
13-
つまり、スクリプトの処理がそこで止まってしまうということです。一方
14-
<function>include</function> の場合は、警告
11+
とほぼ同じですが、失敗した場合に <classname>Error</classname>
12+
も発生する点が異なります(PHP 8.0.0 より前のバージョンでは、
13+
<constant>E_COMPILE_ERROR</constant> が発生していました)。
14+
一方 <function>include</function> の場合は、警告
1515
(<constant>E_WARNING</constant>) を発するもののスクリプトの処理は続行します。
1616
</para>
1717
<para>

0 commit comments

Comments
 (0)