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"); ?>


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

Reply via email to