Re: [PHP] This fact ruins my understanding of php :( please explain!

2002-10-09 Thread Markas
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: > > $

Re: [PHP] This fact ruins my understanding of php :( please explain!

2002-10-08 Thread Rasmus Lerdorf
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

[PHP] :( This fact ruins my understanding of php :( please explain!

2002-10-08 Thread Markas
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

[PHP] This fact ruins my understanding of php :( please explain!

2002-10-08 Thread Markas
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

[PHP] This fact ruins my understanding of php :( please explain!

2002-10-08 Thread Markas
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