com doc/ja: Allow Throwable for $previous param: language/exceptions.xml

[email protected] (Yoshinari Takaoka) Sat, 13 Feb 2021 16:46:44 +0000
Newsgroups php.doc.ja
Message-ID <[email protected]>
Commit:    36d73126291d616a22cb815dbd90d031ff2631d1
Author:    Yoshinari Takaoka <[email protected]>         Sun, 14 Feb 2021 01:46:44 +0900
Parents:   918cca6b5b380acf44eebc6d49efd9ece25a7748
Branches:  master

Link:       http://git.php.net/?p=doc/ja.git;a=commitdiff;h=36d73126291d616a22cb815dbd90d031ff2631d1

Log:
Allow Throwable for $previous param

In current PHP versions the Exception-class seems to allow all Throwable
values for its constructor's $previous param instead of only values of
type Exception.

Closes GH-442.

Changed paths:
  M  language/exceptions.xml


Diff:
diff --git a/language/exceptions.xml b/language/exceptions.xml
index 22d2589b50..90ebf2bd17 100644
--- a/language/exceptions.xml
+++ b/language/exceptions.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- $Revision$ -->
-<!-- EN-Revision: 1d58f726462a821d3f926fb61247357f49fa1ce5 Maintainer: hirokawa Status: ready -->
+<!-- EN-Revision: 46efcedd4ab2dee962eb80c7fbd552252581225b Maintainer: hirokawa Status: ready -->
 <!-- CREDITS: takagi,mumumu -->
 
 <chapter xml:id="language.exceptions" xmlns="http://docbook.org/ns/docbook">
@@ -28,7 +28,7 @@ class Exception extends Throwable
     private   $trace;                           // backtrace
     private   $previous;                        // previous exception if nested exception
 
-    public function __construct($message = null, $code = 0, Exception $previous = null);
+    public function __construct($message = null, $code = 0, Throwable $previous = null);
 
     final private function __clone();           // Inhibits cloning of exceptions.
 
@@ -75,7 +75,7 @@ class Exception extends Throwable
 class MyException extends Exception
 {
     // 例外を再定義し、メッセージをオプションではなくする
-    public function __construct($message, $code = 0, Exception $previous = null) {
+    public function __construct($message, $code = 0, Throwable $previous = null) {
         // なんらかのコード
     
         // 全てを正しく確実に代入する