Exception::__clone
PHP function
Edit on GitHub ✎
(PHP 5, PHP 7, PHP 8)
Clone the exception
Description
Exception::__clone(): void
Exceptions do not support cloning; this method exists only to prevent it.
Warning
Exceptions cannot be cloned, whether they are instances of Exception or of a subclass. Attempting to clone an exception throws an Error, which may be caught.
Parameters Parameters
Return Values
Void
Errors/Exceptions
Exceptions are not clonable.
Changelog
| Version | Description |
|---|---|
| 8.1.0 | Exception::__clone is no longer declared final, because declaring a private method final emits a warning as of PHP 8.0.0. Exceptions remain uncloneable. |