Just to I know, it can't be done by an intermediary method like my previous
example? Why are the limitations to that?
About PR, could you provide some additional tests?
Thanks!
Em qui, 3 de set de 2020 13:37, Michael Voříšek - ČVUT FEL <
voris...@fel.cvut.cz> escreveu:
> The goal is to be able
The goal is to be able to access the original object and it's id/hash.
Usecases:
- something is associated with the object using the object id/hash and
it needs to be cloned as well
we need the original object to obtain it's id/hash for spl_object_id and
spl_object_hash methods
- bounded
On Thu, Sep 3, 2020 at 11:03 AM David Rodrigues
wrote:
> It was just an example to avoid modify how clone works, using existing
> features. :)
>
Right, but the question remains "Why would we want the original object
during a clone operation?". No legitimate example of that has been
provided y
It was just an example to avoid modify how clone works, using existing
features. :)
Em qui, 3 de set de 2020 13:00, Sara Golemon escreveu:
> On Thu, Sep 3, 2020 at 10:40 AM David Rodrigues
> wrote:
>
>> Now I rethinked about what I said. Really, maybe clone is not the best
>> option. So maybe w
On Thu, Sep 3, 2020 at 10:40 AM David Rodrigues
wrote:
> Now I rethinked about what I said. Really, maybe clone is not the best
> option. So maybe we can just use a method that will clone and will have
> access to both informations. But I don't know if it solves the original
> message.
>
> public
Now I rethinked about what I said. Really, maybe clone is not the best
option. So maybe we can just use a method that will clone and will have
access to both informations. But I don't know if it solves the original
message.
public function getUserCopy() {
$userCopy = clone $this;
$this->co
On Wed, Sep 2, 2020 at 2:11 PM David Rodrigues
wrote:
> I understand... seems that `$this` is very confusing inside `__clone()`:
> when writing, it writes to the clone, when reading it reads from original.
>
>
That's not an accurate description of what happens today.
$newObj = clone $oldObj;
//
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 escreveu:
> On Wed, Sep 2, 2020 at 7:41 PM Michael Voříšek - ČVUT FEL <
> voris...@fel.cvut.cz> wrote:
>
> > do y
On Wed, Sep 2, 2020 at 7:41 PM Michael Voříšek - ČVUT FEL <
voris...@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
On Wed, Sep 2, 2020 at 8:42 PM Michael Voříšek - ČVUT FEL <
voris...@fel.cvut.cz> wrote:
> Hi, please look at
>
> https://stackoverflow.com/questions/63675888/get-original-source-instance-in-clone
>
>
> do you have anything against updating PHP to pass "instance before
> cloned" to any __clone cal
I understand... seems that `$this` is very confusing inside `__clone()`:
when writing, it writes to the clone, when reading it reads from original.
Seems valid a new optional parameter definition with the original source.
Atenciosamente,
David Rodrigues
Em qua., 2 de set. de 2020 às 15:41, Mi
Hi, please look at
https://stackoverflow.com/questions/63675888/get-original-source-instance-in-clone
do you have anything against updating PHP to pass "instance before
cloned" to any __clone call from php?
no BC - user may accept this extra argument or declare function
__clone() without any
12 matches
Mail list logo