Exception::__clone
(PHP 5, PHP 7, PHP 8)
Exception::__clone — Clone the exception
Description
private function 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
This function has no parameters.
Return Values
No value is returned.
Errors/Exceptions
Attempting to clone an exception throws an Error
with the following message:
Trying to clone an uncloneable object of class ClassName.