From 95f42fb68121a0a42fed714c90f3eae9bee683c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=A6=E7=94=B0=20=E6=86=B2=E5=A4=AA=E9=83=8E?= Date: Tue, 27 Oct 2026 10:21:36 +0900 Subject: [PATCH] =?UTF-8?q?=E8=A8=80=E8=AA=9E=E3=83=AA=E3=83=95=E3=82=A1?= =?UTF-8?q?=E3=83=AC=E3=83=B3=E3=82=B9=E3=81=AE=E8=AA=AC=E6=98=8E=E3=81=A8?= =?UTF-8?q?=E4=BE=8B=E3=82=92=E5=8E=9F=E6=96=87=E3=81=AE=E5=A4=89=E6=9B=B4?= =?UTF-8?q?=E3=81=AB=E8=BF=BD=E5=BE=93=20(7=E3=83=95=E3=82=A1=E3=82=A4?= =?UTF-8?q?=E3=83=AB)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- language/functions.xml | 17 +++++++++-------- language/oop5/object-comparison.xml | 4 ++-- language/predefined/weakmap/offsetexists.xml | 13 ++++++++++++- language/types/numeric-strings.xml | 6 +++--- language/variables.xml | 19 ++++++++++++++++++- language/wrappers/php.xml | 3 ++- .../functions/session-set-save-handler.xml | 6 ++---- 7 files changed, 48 insertions(+), 20 deletions(-) diff --git a/language/functions.xml b/language/functions.xml index 559b5c56aee..4b29cbbe645 100644 --- a/language/functions.xml +++ b/language/functions.xml @@ -1,6 +1,6 @@ - + 関数 @@ -770,6 +770,13 @@ var_dump(foo(...[1, 2], b: 20)); // Fatal error. Named parameter $b overwrites p + + session_set_save_handler など一部の内部関数には、 + 代替のシグネチャが記載されていますが、 + そのシグネチャの引数名は関数自体には存在しません。 + これらの名前は名前付き引数として使えず、指定するとエラーになります。 + + @@ -1287,13 +1294,7 @@ class Cart public function add($product, $quantity) { - $this->products[$product] = $quantity; - } - - public function getQuantity($product) - { - return isset($this->products[$product]) ? $this->products[$product] : - FALSE; + $this->products[$product] = ($this->products[$product] ?? 0) + $quantity; } public function getTotal($tax) diff --git a/language/oop5/object-comparison.xml b/language/oop5/object-comparison.xml index 4ff234e1258..1db84683fc6 100644 --- a/language/oop5/object-comparison.xml +++ b/language/oop5/object-comparison.xml @@ -1,6 +1,6 @@ - + オブジェクトの比較 @@ -32,7 +32,7 @@ function bool2str($bool) } } -function compareObjects(&$o1, &$o2) +function compareObjects($o1, $o2) { echo 'o1 == o2 : ' . bool2str($o1 == $o2) . "\n"; echo 'o1 != o2 : ' . bool2str($o1 != $o2) . "\n"; diff --git a/language/predefined/weakmap/offsetexists.xml b/language/predefined/weakmap/offsetexists.xml index 0ba5afb8b11..3697c5aebd3 100644 --- a/language/predefined/weakmap/offsetexists.xml +++ b/language/predefined/weakmap/offsetexists.xml @@ -1,6 +1,6 @@ - + WeakMap::offsetExists @@ -40,6 +40,17 @@ そうでない場合、&false; を返します。 + + + &reftitle.notes; + + + isset と同様に、object + に関連付けられた値が &null; の場合は、オブジェクトがマップ内に含まれていても、 + このメソッドは &false; を返します。 + + + - + 数値形式の文字列 @@ -65,7 +65,7 @@ var_dump("2E1" == "020"); // true, "2E1" は 2 * (10 ^ 1), または 20 文字列が数値の場合、その文字列が整数の数値形式の文字列であり、かつ int 型の範囲 - (PHP_INT_MAX で定義されています) + (PHP_INT_MIN と PHP_INT_MAX で定義されています) に含まれる場合、int に解決されます。 そうでない場合、float に解決されます。 @@ -77,7 +77,7 @@ var_dump("2E1" == "020"); // true, "2E1" は 2 * (10 ^ 1), または 20 文字列の先頭部分が整数の数値形式の文字列であり、かつそれが int 型の範囲 - (PHP_INT_MAX で定義されています) + (PHP_INT_MIN と PHP_INT_MAX で定義されています) に含まれる場合、int に解決されます。 そうでない場合、float に解決されます。 diff --git a/language/variables.xml b/language/variables.xml index 9d390a8388a..86f02196552 100644 --- a/language/variables.xml +++ b/language/variables.xml @@ -1,6 +1,6 @@ - + @@ -536,12 +536,29 @@ function test() if ($count < 10) { test(); } + // インクリメントを取り消します。これで test() の終了時には $count が 0 に戻り、 + // 後で test() を呼び出したときも 1 から数え直します $count--; } test(); ]]> + &example.outputs; + + + diff --git a/language/wrappers/php.xml b/language/wrappers/php.xml index 25624ffce96..6e6c0ad33c0 100644 --- a/language/wrappers/php.xml +++ b/language/wrappers/php.xml @@ -1,6 +1,6 @@ - + @@ -45,6 +45,7 @@ php://input は読み込み専用のストリームで、 リクエストの body 部から生のデータを読み込むことができます。 + 何度でもオープンして読み込めます。 enable_post_data_reading オプションが有効になっている場合、 かつ enctype="multipart/form-data" を指定した POST リクエストでは、php://input は使用できません。 diff --git a/reference/session/functions/session-set-save-handler.xml b/reference/session/functions/session-set-save-handler.xml index 6f2eef76f4b..4c91500c937 100644 --- a/reference/session/functions/session-set-save-handler.xml +++ b/reference/session/functions/session-set-save-handler.xml @@ -1,6 +1,6 @@ - + @@ -21,9 +21,7 @@ callablevalidate_sid callableupdate_timestamp - - 次のプロトタイプでも登録できます。 - + 代替のシグネチャ (名前付き引数をサポートしていません): boolsession_set_save_handler objectsessionhandler