[php-src] Issue #14342: Exceptions are still not clonable even if Exception::__clone() is no longer final
| From: | SigmaFlame | Date: | Mon, 27 May 2024 23:09:34 +0000 |
| Subject: | [php-src] Issue #14342: Exceptions are still not clonable even if Exception::__clone() is no longer final | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-246972@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/14342
Author: SigmaFlame
### Description
Hello,
While reading the PHP documentation, I have read that the method Exception::__clone() is no longer
final since PHP 8.1.
But, trying to extend the class Exception and making its own « public function __clone() » does
not work and still produce an error.
« Trying to clone an uncloneable object of class ExtendedException »
What is the purpose of removing the final attribute of this method if we still can't clone an
exception?
I would like to make the exception clonable in order to update the file and line where the exception
has occurred.
Thanks you in advance.
### PHP Version
8.3.7
### Operating System
_No response_