Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<Error::__toStringArgumentCountError>
^ErrorLast updated: Mon, 26 Oct 2026

Error::__clone

(PHP 7, PHP 8)

Error::__clone — Clone the error

Description

private function Error::__clone(): void

Errors do not support cloning; this method exists only to prevent it.

Warning

Errors cannot be cloned, whether they are instances of Error or of a subclass. Attempting to clone an error 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 error throws an Error with the following message: Trying to clone an uncloneable object of class ClassName.

Changelog

Version Description
8.1.0 Error::__clone() is no longer final.

<Error::__toStringArgumentCountError>
^ErrorLast updated: Mon, 26 Oct 2026