Re: Re: #20993 [Ver]: Element value changeswithoutasking

From: Date: Mon, 16 Dec 2002 02:00:37 +0000
Subject: Re: Re: #20993 [Ver]: Element value changeswithoutasking
References: 1 2 3  Groups: php.dev 
Request: Send a blank email to php-dev+get-92510@lists.php.net to get a copy of this message
At 21:48 15-12-2002, Andi Gutmans wrote:
I don't understand what you're doing here. Are you actually separating on every assignment and doing a deep copy?
Well, like I said: I don't if it's the best solution. What is nasty, is that: <?php $a = array(1); $ref = $a[0]; changeVal($a); echo $a[0]; function changeVal($arr) {
        $arr[0]=2;
} ?> prints 2, instead of 1, IE: the array has become global, just by creating a reference to one of it's keys.
Andi At 04:09 PM 12/15/2002 +0900, Moriyoshi Koizumi wrote:
[...]
And the result of a tiny benchmark follows: [Before patching] 1: 0.263245 2: 0.142505 3: 0.328045 4: 0.137149 [After patching] 1: 0.273811 2: 0.141965 3: 0.699429 4: 0.137010
What's 1,2,3 and 4?
Moriyoshi
My proposal, was based on 2 things: fix or document. I'm sure
Zeev/Andi had a
good reason not to always separate, and that probably is performance. IF this impacts overall performance very negatively, then maybe the better choice is to document it. I'll try the patch though. 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
With kind regards, Melvyn Sopacua <?php include("not_reflecting_employers_views.txt"); ?>

« previous php.dev (#92510) next »