[DOC-CVS] [doc-en] master: Use explicit nullable type in language/exceptions.xml (#4631)

[email protected] (Ben Faerber via GitHub)
Newsgroups php.doc.cvs
Message-ID <[email protected]>
Author: Ben Faerber (benfaerber)
Committer: GitHub (web-flow)
Pusher: TimWolla
Date: 2025-04-27T00:11:05+02:00

Commit: https://github.com/php/doc-en/commit/402a72776804fbb74ec5c4cad72d4c7b6cdd5b2d
Raw diff: https://github.com/php/doc-en/commit/402a72776804fbb74ec5c4cad72d4c7b6cdd5b2d.diff

Use explicit nullable type in language/exceptions.xml (#4631)

Changed paths:
  M  language/exceptions.xml


Diff:

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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.