diff --git a/language/constants.xml b/language/constants.xml index 5dfbcb3e28..48aefcb400 100644 --- a/language/constants.xml +++ b/language/constants.xml @@ -1,9 +1,9 @@ - + - + 定数 @@ -40,7 +40,7 @@ 有効/無効な定数名の例 - + ]]> @@ -181,7 +179,6 @@ define("CONSTANT", "Hello world."); echo CONSTANT; // "Hello world."を出力 echo Constant; // エラーが発生: Undefined constant "Constant" // PHP 8.0.0 より前のバージョンでは、"Constant" を出力し、警告が発生 -?> ]]> @@ -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" ]]> diff --git a/language/exceptions.xml b/language/exceptions.xml index 937a387c36..719b626148 100644 --- a/language/exceptions.xml +++ b/language/exceptions.xml @@ -1,10 +1,13 @@ - + - + 例外(exceptions) + + Exception クラスも参照ください + PHP は、他のプログラミング言語に似た例外モデルを持っています。 PHP 内で例外がスローされ (&throw; され)、それが @@ -134,7 +137,7 @@ エラーを例外に変換する - + ]]> @@ -179,7 +181,6 @@ try { // 実行は継続される echo "Hello World\n"; -?> ]]> &example.outputs; @@ -222,7 +223,6 @@ try { // 実行は継続される echo "Hello World\n"; -?> ]]> &example.outputs; @@ -253,7 +253,6 @@ function test() { } echo test(); -?> ]]> &example.outputs; @@ -288,8 +287,6 @@ class Test { $foo = new Test; $foo->testing(); - -?> ]]> &example.outputs; @@ -321,8 +318,6 @@ class Test { $foo = new Test; $foo->testing(); - -?> ]]> &example.outputs; @@ -348,7 +343,6 @@ try { } catch (SpecificException) { print "A SpecificException was thrown, but we don't care about the details."; } -?> ]]> &example.outputs; @@ -380,7 +374,6 @@ try { } catch (Exception $e) { print $e->getMessage(); } -?> ]]> &example.outputs; @@ -427,13 +420,13 @@ string(6) "Fourth" 例外を拡張する - 組み込みの Exception クラスを拡張することで、例外クラスをユーザーが + 組み込みの Exception クラスを拡張することで、例外クラスをユーザーが 定義することが可能です。以下のメンバーおよびプロパティは、 組み込みの Exception クラスから派生した子クラスの中でアクセス可能です。 組み込みの例外クラス - + ]]> - クラスが、組み込みの Exception クラスを拡張し、 + クラスが、組み込みの Exception クラスを拡張し、 コンストラクタを再定義した場合、 全ての利用可能なデータが正しく代入されることを保証するために @@ -544,7 +536,7 @@ class TestException } -// 例1 +echo "# Example 1\n"; try { $o = new TestException(TestException::THROW_CUSTOM); } catch (MyException $e) { // ここでキャッチされる @@ -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) { // この型にはマッチしない @@ -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) { // ここでキャッチされる @@ -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) { // スキップされる、例外は発生しない @@ -595,8 +584,6 @@ try { // 実行を継続する var_dump($o); // TestException -echo "\n\n"; -?> ]]> diff --git a/language/expressions.xml b/language/expressions.xml index ffdd2bdc63..33dc5e9c16 100644 --- a/language/expressions.xml +++ b/language/expressions.xml @@ -1,8 +1,8 @@ - + - + @@ -32,7 +32,7 @@ 例えば、次の関数を考えてみましょう。 - + - + ]]> diff --git a/reference/curl/constants_curl_setopt.xml b/reference/curl/constants_curl_setopt.xml index c00aacc8fd..40f43b7966 100644 --- a/reference/curl/constants_curl_setopt.xml +++ b/reference/curl/constants_curl_setopt.xml @@ -1,6 +1,6 @@ - + <function>curl_setopt</function> @@ -185,7 +185,7 @@ - 相手を検証するための証明書を格納した PEM ファイル名を string で指定します。 + 相手を検証するための証明書を含む、PEM 形式でエンコードされたコンテンツを、バイナリ string で指定します。 このオプションは CURLOPT_CAINFO を上書きします。 PHP 8.2.0 以降かつ cURL 7.77.0 以降で利用可能です。 @@ -1727,12 +1727,12 @@ (int) - + HTTP リダイレクトの最大回数を指定します。CURLOPT_FOLLOWLOCATION と合わせて使用してください。 デフォルト値の 20 は、無限リダイレクトを防ぐために設定されています。 -1 を指定すると何度でもリダイレクトするようになります。0 を指定すると一切リダイレクトしなくなります。 cURL 7.5.0 以降で利用可能です。 - + diff --git a/reference/fileinfo/functions/finfo-buffer.xml b/reference/fileinfo/functions/finfo-buffer.xml index c9274d59d2..74176d5629 100644 --- a/reference/fileinfo/functions/finfo-buffer.xml +++ b/reference/fileinfo/functions/finfo-buffer.xml @@ -1,6 +1,6 @@ - + @@ -85,6 +85,12 @@ + + 8.5.0 + + context パラメータは、無視されるため非推奨になりました。 + + &fileinfo.changelog.finfo-object; 8.0.0 diff --git a/reference/reflection/reflectionclass/getconstant.xml b/reference/reflection/reflectionclass/getconstant.xml index 879063def8..37bf172beb 100644 --- a/reference/reflection/reflectionclass/getconstant.xml +++ b/reference/reflection/reflectionclass/getconstant.xml @@ -1,6 +1,6 @@ - + @@ -43,7 +43,31 @@ そのクラスに定数が見つからなかった場合は、&false; を返します。 - + + + &reftitle.changelog; + + + + + &Version; + &Description; + + + + + 8.5.0 + + 存在しない定数に対して + ReflectionClass::getConstant + を呼び出すのは非推奨となりました。 + + + + + + + &reftitle.examples; diff --git a/reference/reflection/reflectionmethod/setaccessible.xml b/reference/reflection/reflectionmethod/setaccessible.xml index 03701c9fb1..70f72948ff 100644 --- a/reference/reflection/reflectionmethod/setaccessible.xml +++ b/reference/reflection/reflectionmethod/setaccessible.xml @@ -1,6 +1,6 @@ - + @@ -55,6 +55,35 @@ + + &reftitle.changelog; + + + + + &Version; + &Description; + + + + + 8.5.0 + + 効果がなくなったため、このメソッドは非推奨になりました。 + + + + 8.1.0 + + このメソッドをコールしても何も起こりません。 + 全てのメソッドはデフォルトで呼び出し可能です。 + + + + + + + &reftitle.examples; diff --git a/reference/reflection/reflectionproperty/getdefaultvalue.xml b/reference/reflection/reflectionproperty/getdefaultvalue.xml index 81e608ac44..53b48c2805 100644 --- a/reference/reflection/reflectionproperty/getdefaultvalue.xml +++ b/reference/reflection/reflectionproperty/getdefaultvalue.xml @@ -1,6 +1,6 @@ - + @@ -26,12 +26,36 @@ &reftitle.returnvalues; - + プロパティに何かしらデフォルト値が存在する場合(&null;も含みます)、 それを返します。デフォルト値がない場合、&null; を返します。 - デフォルト値が &null; の場合と、型付きプロパティが初期化されてない場合は区別できません。 + デフォルト値が &null; の場合と、型付きプロパティが初期化されてない場合は区別できません。 それらを区別するには、ReflectionProperty::hasDefaultValue を使って下さい。 - + + + + + &reftitle.changelog; + + + + + &Version; + &Description; + + + + + 8.5.0 + + デフォルト値を持たないプロパティに対して + ReflectionProperty::getDefaultValue + を呼び出すのは非推奨となりました。 + + + + + diff --git a/reference/reflection/reflectionproperty/setaccessible.xml b/reference/reflection/reflectionproperty/setaccessible.xml index ba8e0748d3..c1d344a7c3 100644 --- a/reference/reflection/reflectionproperty/setaccessible.xml +++ b/reference/reflection/reflectionproperty/setaccessible.xml @@ -1,6 +1,6 @@ - + @@ -56,6 +56,35 @@ + + &reftitle.changelog; + + + + + &Version; + &Description; + + + + + 8.5.0 + + 効果がなくなったため、このメソッドは非推奨になりました。 + + + + 8.1.0 + + このメソッドをコールしても何も起こりません。 + 全てのプロパティはデフォルトでアクセス可能です。 + + + + + + + &reftitle.examples; diff --git a/reference/spl/functions/spl-autoload-unregister.xml b/reference/spl/functions/spl-autoload-unregister.xml index 787d965726..5e8704376b 100644 --- a/reference/spl/functions/spl-autoload-unregister.xml +++ b/reference/spl/functions/spl-autoload-unregister.xml @@ -1,6 +1,6 @@ - + @@ -47,6 +47,32 @@ + + &reftitle.changelog; + + + + + &Version; + &Description; + + + + + 8.5.0 + + 全てのオートローダの登録を解除するために、 + spl_autoload_call 関数をコールバック引数として渡すことは + 非推奨になりました。 + 代わりに spl_autoload_functions の戻り値を反復処理し、 + それぞれの値に対して spl_autoload_unregister を呼び出してください。 + + + + + + + - + @@ -63,6 +63,30 @@ + + &reftitle.changelog; + + + + + &Version; + &Description; + + + + + 8.5.0 + + このメソッドは非推奨となりました。 + 代わりに SplObjectStorage::offsetSet + を使用してください。 + + + + + + + &reftitle.examples; diff --git a/reference/spl/splobjectstorage/contains.xml b/reference/spl/splobjectstorage/contains.xml index c12d1b2469..017671aa8e 100644 --- a/reference/spl/splobjectstorage/contains.xml +++ b/reference/spl/splobjectstorage/contains.xml @@ -1,6 +1,6 @@ - + SplObjectStorage::contains @@ -46,6 +46,29 @@ + + &reftitle.changelog; + + + + + &Version; + &Description; + + + + + 8.5.0 + + このメソッドは非推奨となりました。代わりに + SplObjectStorage::offsetExists を使用してください。 + + + + + + + &reftitle.examples; diff --git a/reference/spl/splobjectstorage/detach.xml b/reference/spl/splobjectstorage/detach.xml index 3b0726ec8e..142fa080b4 100644 --- a/reference/spl/splobjectstorage/detach.xml +++ b/reference/spl/splobjectstorage/detach.xml @@ -1,6 +1,6 @@ - + SplObjectStorage::detach @@ -46,6 +46,30 @@ + + &reftitle.changelog; + + + + + &Version; + &Description; + + + + + 8.5.0 + + このメソッドは非推奨となりました。 + 代わりに SplObjectStorage::offsetUnset + を使用してください。 + + + + + + + &reftitle.examples; diff --git a/reference/strings/functions/chr.xml b/reference/strings/functions/chr.xml index ee7f084a42..287360d61f 100644 --- a/reference/strings/functions/chr.xml +++ b/reference/strings/functions/chr.xml @@ -1,6 +1,6 @@ - + @@ -79,6 +79,12 @@ $bytevalue %= 256; + + 8.5.0 + + [0, 255] の範囲外の整数を渡すことは非推奨になりました。 + + 7.4.0 diff --git a/reference/strings/functions/ord.xml b/reference/strings/functions/ord.xml index a41382408f..3691249f98 100644 --- a/reference/strings/functions/ord.xml +++ b/reference/strings/functions/ord.xml @@ -1,6 +1,6 @@ - + @@ -54,6 +54,28 @@ + + &reftitle.changelog; + + + + + &Version; + &Description; + + + + + 8.5.0 + + シングルバイトではない文字列を渡すことは非推奨になりました。 + + + + + + + &reftitle.examples;