Re: Pass source object to clone like __clone($origThis)
| From: | David Rodrigues | Date: | Thu, 03 Sep 2020 13:41:52 +0000 |
| Subject: | Re: Pass source object to clone like __clone($origThis) | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-111817@lists.php.net to get a copy of this message | ||
I don't see problem to allow modify the original object, once that you are
doing it by using a new argument, and not the $this itself.
Em qui, 3 de set de 2020 08:49, Pedro Magalhães <mail@pmmaga.net> escreveu:
> On Wed, Sep 2, 2020 at 7:41 PM Michael Voříšek - ČVUT FEL <
> vorismi3@fel.cvut.cz> wrote:
>
> > do you have anything against updating PHP to pass "instance before
> > cloned" to any __clone call from php?
> >
>
> Yes, I think that allowing the original object to be modified by a cloning
> operation could be the cause for a lot of confusion. If we had a proper way
> to make it read-only I wouldn't mind, but as is, it doesn't sound like a
> good idea.
>