Yes I object. Think of references as a "symbolic link" to the same place. Now you have such a reference in an array which you assign to an additional variable. Now two variables contain copies of an array but somewhere inside you have two copies of the symbolic link. Changing one will change the other. In many ways it makes sense, and even in cases where it's a bit weird and where it seems wrong, I think we should live with it because I don't like having to check the whole array each time. If you have deeply nested arrays it's really slow and doesn't make that much sense.

Andi

At 05:24 PM 12/21/2002 +0100, Melvyn Sopacua wrote:
At 17:16 18-12-2002, Moriyoshi Koizumi wrote:

Melvyn Sopacua <[EMAIL PROTECTED]> wrote:

--snip
> > > OK so that's a deep copy. As much as I understand the motivation I don't
> > > think this should be done. It'll slow down lots of things in PHP. I think
> > > this should be solved by documentation.
> >
> >Yes, according to my trivial benchmark, my patch puts a considerable
> >weight on the ZendEngine, to run twice as slowly as the current runtime in
> >the worst case. Seems no way, but I suppose it also sounds a reasonable
> >penalty of using references.
>
> Actually - the natural 'feeling' with references is speed increases - not
> slowdowns,
> since one expects a 'pointer', rather than a copy.
>
> Is there a way to warn when such a refstatement is detected, without
> causing slowdowns?

Then try the new patch. It prints out notices in such cases.
Attached is a slightly revised version against PHP_4_3 branch - just an 'english'
fix.

If there are no objections, can somebody commit it?

I'll fix the test accordingly.


With kind regards,

Melvyn Sopacua
<?php include("not_reflecting_employers_views.txt"); ?>


--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to