Message::__clone()

In this article

Performs a deep clone of the message.

Description

This method ensures that message part objects are cloned to prevent modifications to the cloned message from affecting the original.

Source

public function __clone()
{
    $clonedParts = [];
    foreach ($this->parts as $part) {
        $clonedParts[] = clone $part;
    }
    $this->parts = $clonedParts;
}

Changelog

VersionDescription
0.4.2Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.