diff --git a/language/exceptions.xml b/language/exceptions.xml index 39b54c943450..d81e4e8b38ed 100644 --- a/language/exceptions.xml +++ b/language/exceptions.xml @@ -386,7 +386,7 @@ class Exception implements Throwable private $trace; // backtrace private $previous; // previous exception if nested exception - public function __construct($message = '', $code = 0, Throwable $previous = null); + public function __construct($message = '', $code = 0, ?Throwable $previous = null); final private function __clone(); // Inhibits cloning of exceptions. @@ -432,7 +432,7 @@ class Exception implements Throwable class MyException extends Exception { // Redefine the exception so message isn't optional - public function __construct($message, $code = 0, Throwable $previous = null) { + public function __construct($message, $code = 0, ?Throwable $previous = null) { // some code // make sure everything is assigned properly