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

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to