Re: [RFC] [Discussion] Clone with
| From: | Tim Düsterhus | Date: | Tue, 18 Apr 2023 08:19:54 +0000 |
| Subject: | Re: [RFC] [Discussion] Clone with | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-120063@lists.php.net to get a copy of this message | ||
Hi
On 4/18/23 10:10, Rowan Tommins wrote:
2) How does this interact with an __clone() method? I'm guessing the __clone() would be called first, and then the with-clause applied?More generally the order of operations with regard to possible side effects and/or exceptions would be interesting. clone $something with {
foo() => bar(),
quux() => baz(),
};
In which order will __clone(), foo(), bar(), quux(), baz() be evaluated and what will happen if one of them throws an Exception? Will destructors of the cloned object run? When?
Best regards
Tim Düsterhus