clone

Exception::__clone

Clone the exception

ENTITY

private

void

Exception::__clone

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.

ENTITY ENTITY

ENTITY

ENTITY

ENTITY

Attempting to clone an exception throws an Error with the following message: Trying to clone an uncloneable object of class ClassName.

ENTITY

ENTITY ENTITY
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.

版本号 #2
由 壳壳虫 创建于 2026-10-31 17:43:28 UTC
由 壳壳虫 更新于 2026-10-31 17:43:29 UTC