Hi Rowan and Alexandru, I'm not totally clear what this sentence is saying: > > > Reinitialization can only take place /during/ the |__clone()| magic > method call, no matter if the actual assignment happens in a different > method or function invoked inside |__clone()|. > > Are you saying that invoking a separate method like > "setSomeProperty($blah)" from __clone() is allowed, or that it isn't? > Perhaps a couple of extra examples could be added to this section > demonstrating what would and wouldn't be allowed? >
Sorry, I tried hard to articulate the behavior, but then the wording still needs some clarification. So this sentence was intended to convey that properties can be reinitialized during the execution of the __clone() magic method either if the assignment happens directly in this method, or in any method invoked by __clone(). Is it clearer now? Thanks for pointing this problem out, and any help with the wording is appreciated! For proposal 2 part: "Readonly properties can be reinitialized during > cloning" > From the details there I understand it would affect properties in a > readonly class as well as explicit readonly properties in non-readonly class. Is that the intent? If yes, > maybe we can share an example without a readonly class as well. I didn't bother to add a separate example for explicit readonly properties, because I mainly regard readonly classes as a shorthand for adding the readonly modifier for all properties (even though I know there are some other differences between readonly and non-readonly classes). That's why I don't think it's worth adding two different examples, but I'm ok with having one example with simply readonly properties, without the readonly class modifier. I think the example will be clear enough this way. Regards: Máté