Thnaks for an explanation.
Rasmus Lerdorf <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> This has been explained a few times. PHP does shallow copies, or
> copy-on-write which means that the data is not actually copied until you
> change it. That is:
>
> $
This has been explained a few times. PHP does shallow copies, or
copy-on-write which means that the data is not actually copied until you
change it. That is:
$a = "1234567890";
$b = $a;
internally we do not copy the data from $a to $b until you change $b.
We you use references we have a b
I tried some trivial expirements:
/* here I define an array $big, which I guess would "eat" ~100kb of memory
*/
for($i=0; $i<1; $i++)
{
$big[$i] = "1234567890";
}
/* this func only returns the value it gets as a param...*/
function f($a){return $a;}
$start = microtime();
/* here all the j
I tried some trivial expirements:
/* here I define an array $big, which I guess would "eat" ~100kb of memory
*/
for($i=0; $i<1; $i++)
{
$big[$i] = "1234567890";
}
/* this func only returns the value it gets as a param...*/
function f($a){return $a;}
$start = microtime();
/* here all the j
I tried some trivial expirements:
/* here I define an array $big, which I guess would "eat" ~100kb of memory */
for($i=0; $i<1; $i++)
{
$big[$i] = "1234567890";
}
/* this func only returns the value it gets as a param...*/
function f($a){return $a;}
$start = microtime();
/* here all t
5 matches
Mail list logo