Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions language/constants.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: f4f96ef8b2a95283c92ea2183fe1dedf06f3ad22 Maintainer: hirokawa Status: ready -->
<!-- EN-Revision: 6e885e52412ad979aa5fbb620bb84e886fc0ebe8 Maintainer: hirokawa Status: ready -->
<!-- CREDITS: takagi,mumumu -->

<chapter xml:id="language.constants" xmlns="http://docbook.org/ns/docbook">
<chapter xml:id="language.constants" xmlns="http://docbook.org/ns/docbook" annotations="interactive">
<title>定数</title>

<simpara>
Expand Down Expand Up @@ -40,7 +40,7 @@
<!-- TODO Move into syntax section? -->
<example>
<title>有効/無効な定数名の例</title>
<programlisting role="php">
<programlisting role="php" annotations="non-interactive">
<![CDATA[
<?php

Expand All @@ -56,8 +56,6 @@ define("2FOO", "something");
// 将来 PHP に定数の予約語が追加された場合に
// スクリプトが動作しなくなる可能性がある
define("__FOO__", "something");

?>
]]>
</programlisting>
</example>
Expand Down Expand Up @@ -181,7 +179,6 @@ define("CONSTANT", "Hello world.");
echo CONSTANT; // "Hello world."を出力
echo Constant; // エラーが発生: Undefined constant "Constant"
// PHP 8.0.0 より前のバージョンでは、"Constant" を出力し、警告が発生
?>
]]>
</programlisting>
</example>
Expand All @@ -196,23 +193,22 @@ echo Constant; // エラーが発生: Undefined constant "Constant"
// 単純なスカラー値
const CONSTANT = 'Hello World';

echo CONSTANT;
echo CONSTANT . "\n";

// スカラー式
const ANOTHER_CONST = CONSTANT.'; Goodbye World';
echo ANOTHER_CONST;
const ANOTHER_CONST = CONSTANT . '; Goodbye World';
echo ANOTHER_CONST . "\n";

const ANIMALS = array('dog', 'cat', 'bird');
echo ANIMALS[1]; // 出力は "cat"
echo ANIMALS[1] . "\n"; // 出力は "cat"

// 配列の定数
define('ANIMALS', array(
define('ANIMALS_DEF', array(
'dog',
'cat',
'bird'
));
echo ANIMALS[1]; // 出力は "cat"
?>
echo ANIMALS_DEF[1] . "\n"; // 出力は "cat"
]]>
</programlisting>
</example>
Expand Down
41 changes: 14 additions & 27 deletions language/exceptions.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: c81a48e58fc530a74827316027fae74668d17a1d Maintainer: hirokawa Status: ready -->
<!-- EN-Revision: 525aa5f198d482c0d03be54ddee5af13b376ab99 Maintainer: hirokawa Status: ready -->
<!-- CREDITS: takagi,mumumu -->

<chapter xml:id="language.exceptions" xmlns="http://docbook.org/ns/docbook">
<chapter xml:id="language.exceptions" xmlns="http://docbook.org/ns/docbook" annotations="interactive">
<title>例外(exceptions)</title>
<note>
<simpara><exceptionname>Exception</exceptionname> クラスも参照ください</simpara>
</note>
<para>
PHP は、他のプログラミング言語に似た例外モデルを持っています。
PHP 内で例外がスローされ (&throw; され)、それが
Expand Down Expand Up @@ -134,15 +137,14 @@
</para>
<example>
<title>エラーを例外に変換する</title>
<programlisting role="php">
<programlisting role="php" annotations="non-interactive">
<![CDATA[
<?php
function exceptions_error_handler($severity, $message, $filename, $lineno) {
throw new ErrorException($message, 0, $severity, $filename, $lineno);
}

set_error_handler('exceptions_error_handler');
?>
]]>
</programlisting>
</example>
Expand Down Expand Up @@ -179,7 +181,6 @@ try {

// 実行は継続される
echo "Hello World\n";
?>
]]>
</programlisting>
&example.outputs;
Expand Down Expand Up @@ -222,7 +223,6 @@ try {

// 実行は継続される
echo "Hello World\n";
?>
]]>
</programlisting>
&example.outputs;
Expand Down Expand Up @@ -253,7 +253,6 @@ function test() {
}

echo test();
?>
]]>
</programlisting>
&example.outputs;
Expand Down Expand Up @@ -288,8 +287,6 @@ class Test {

$foo = new Test;
$foo->testing();

?>
]]>
</programlisting>
&example.outputs;
Expand Down Expand Up @@ -321,8 +318,6 @@ class Test {

$foo = new Test;
$foo->testing();

?>
]]>
</programlisting>
&example.outputs;
Expand All @@ -348,7 +343,6 @@ try {
} catch (SpecificException) {
print "A SpecificException was thrown, but we don't care about the details.";
}
?>
]]>
</programlisting>
&example.outputs;
Expand Down Expand Up @@ -380,7 +374,6 @@ try {
} catch (Exception $e) {
print $e->getMessage();
}
?>
]]>
</programlisting>
&example.outputs;
Expand Down Expand Up @@ -427,13 +420,13 @@ string(6) "Fourth"
<sect1 xml:id="language.exceptions.extending">
<title>例外を拡張する</title>
<para>
組み込みの Exception クラスを拡張することで、例外クラスをユーザーが
組み込みの <exceptionname>Exception</exceptionname> クラスを拡張することで、例外クラスをユーザーが
定義することが可能です。以下のメンバーおよびプロパティは、
組み込みの Exception クラスから派生した子クラスの中でアクセス可能です。
</para>
<example>
<title>組み込みの例外クラス</title>
<programlisting role="php">
<programlisting role="php" annotations="non-interactive">
<![CDATA[
<?php
class Exception implements Throwable
Expand All @@ -458,15 +451,14 @@ class Exception implements Throwable
final public function getPrevious(); // previous exception
final public function getTraceAsString(); // formatted string of trace

// Overrideable
// Overridable
public function __toString(); // formatted string for display
}
?>
]]>
</programlisting>
</example>
<para>
クラスが、組み込みの Exception クラスを拡張し、
クラスが、組み込みの <exceptionname>Exception</exceptionname> クラスを拡張し、
<link linkend="language.oop5.decon">コンストラクタ</link>を再定義した場合、
全ての利用可能なデータが正しく代入されることを保証するために
<link linkend="language.oop5.paamayim-nekudotayim">
Expand Down Expand Up @@ -544,7 +536,7 @@ class TestException
}


// 例1
echo "# Example 1\n";
try {
$o = new TestException(TestException::THROW_CUSTOM);
} catch (MyException $e) { // ここでキャッチされる
Expand All @@ -556,10 +548,9 @@ try {

// 実行を継続する
var_dump($o); // Null
echo "\n\n";


// 例2
echo "\n\n# Example 2\n";
try {
$o = new TestException(TestException::THROW_DEFAULT);
} catch (MyException $e) { // この型にはマッチしない
Expand All @@ -571,10 +562,9 @@ try {

// 実行を継続する
var_dump($o); // Null
echo "\n\n";


// 例3
echo "\n\n# Example 3\n";
try {
$o = new TestException(TestException::THROW_CUSTOM);
} catch (Exception $e) { // ここでキャッチされる
Expand All @@ -583,10 +573,9 @@ try {

// 実行を継続する
var_dump($o); // Null
echo "\n\n";


// 例4
echo "\n\n# Example 4\n";
try {
$o = new TestException();
} catch (Exception $e) { // スキップされる、例外は発生しない
Expand All @@ -595,8 +584,6 @@ try {

// 実行を継続する
var_dump($o); // TestException
echo "\n\n";
?>
]]>
</programlisting>
</example>
Expand Down
22 changes: 16 additions & 6 deletions language/expressions.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: f4f96ef8b2a95283c92ea2183fe1dedf06f3ad22 Maintainer: hirokawa Status: ready -->
<!-- EN-Revision: 6e885e52412ad979aa5fbb620bb84e886fc0ebe8 Maintainer: hirokawa Status: ready -->
<!-- CREDITS: takagi,mumumu -->
<chapter xml:id="language.expressions" xmlns="http://docbook.org/ns/docbook">
<chapter xml:id="language.expressions" xmlns="http://docbook.org/ns/docbook" annotations="interactive">
<title>式</title>

<simpara>
Expand Down Expand Up @@ -32,7 +32,7 @@
例えば、次の関数を考えてみましょう。

<informalexample>
<programlisting role="php">
<programlisting role="php" annotations="non-interactive">
<![CDATA[
<?php
function foo () {
Expand Down Expand Up @@ -155,7 +155,7 @@ function foo () {
</para>
<para>
<informalexample>
<programlisting role="php">
<programlisting role="php" annotations="non-interactive">
<![CDATA[
<?php
$first ? $second : $third
Expand All @@ -179,24 +179,34 @@ $first ? $second : $third
<programlisting role="php">
<![CDATA[
<?php
function double($i) {
return $i*2;
function double($i)
{
return $i * 2;
}

$b = $a = 5; /* 値 5 を $a と $b に代入します */
$c = $a++; /* 後置加算なので、$c に代入される値は、$a の
元の値 (5) です */
print "a = {$a}; b = {$b}; c = {$c}" . PHP_EOL;

$e = $d = ++$b; /* 前置加算なので、$d と $e に代入される値は、
加算後の $b の値 (6) です */
print "b = {$b}; d = {$d}; e = {$e}" . PHP_EOL;

/* ここまでで、$d と $e は、6 です */

$f = double($d++); /* $f には、$d が加算される前の値を2倍した値、
つまり 2*6 = 12 が、代入されます。 */
print "d = {$d}; f = {$f}" . PHP_EOL;

$g = double(++$e); /* $g には、$e が加算された後の値を2倍した値、
つまり 2*7 = 14 が、代入されます。 */
print "e = {$e}; g = {$g}" . PHP_EOL;

$h = $g += 10; /* まず、$g に 10 が加算され、24 になります。
代入値 (24) は、$h に代入されます。
そして、$h も同様に 24 になります。 */
print "g = {$g}; h = {$h}" . PHP_EOL;
?>
]]>
</programlisting>
Expand Down
8 changes: 4 additions & 4 deletions reference/curl/constants_curl_setopt.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: d7d6dd60085409b295916649e4bd7107742659a2 Maintainer: nsfisis Status: ready -->
<!-- EN-Revision: 525aa5f198d482c0d03be54ddee5af13b376ab99 Maintainer: nsfisis Status: ready -->
<variablelist role="constant_list">
<title><function>curl_setopt</function></title>
<varlistentry xml:id="constant.curlopt-abstract-unix-socket">
Expand Down Expand Up @@ -185,7 +185,7 @@
</term>
<listitem>
<para>
相手を検証するための証明書を格納した PEM ファイル名を <type>string</type> で指定します。
相手を検証するための証明書を含む、PEM 形式でエンコードされたコンテンツを、バイナリ <type>string</type> で指定します。
このオプションは <constant>CURLOPT_CAINFO</constant> を上書きします。
PHP 8.2.0 以降かつ cURL 7.77.0 以降で利用可能です。
</para>
Expand Down Expand Up @@ -1727,12 +1727,12 @@
(<type>int</type>)
</term>
<listitem>
<para>
<simpara>
HTTP リダイレクトの最大回数を指定します。<constant>CURLOPT_FOLLOWLOCATION</constant> と合わせて使用してください。
デフォルト値の <literal>20</literal> は、無限リダイレクトを防ぐために設定されています。
<literal>-1</literal> を指定すると何度でもリダイレクトするようになります。<literal>0</literal> を指定すると一切リダイレクトしなくなります。
cURL 7.5.0 以降で利用可能です。
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.curlopt-max-recv-speed-large">
Expand Down
8 changes: 7 additions & 1 deletion reference/fileinfo/functions/finfo-buffer.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 82ddd2ec8ad195035dcb57dd8f97d27b83ddc126 Maintainer: takagi Status: ready -->
<!-- EN-Revision: e5c8e7add9291c70be2ecd046de6ecfd034545a9 Maintainer: takagi Status: ready -->
<!-- Credits: mumumu -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.finfo-buffer">
<refnamediv>
Expand Down Expand Up @@ -85,6 +85,12 @@
</row>
</thead>
<tbody>
<row>
<entry>8.5.0</entry>
<entry>
<parameter>context</parameter> パラメータは、無視されるため非推奨になりました。
</entry>
</row>
&fileinfo.changelog.finfo-object;
<row>
<entry>8.0.0</entry>
Expand Down
Loading
Loading