Posted by Chung Leong on 12/10/08 11:51
Mladen Gogala wrote:
>
> Andy replied below so I will not repeat his answer but will only add
> that you can explicitly declare arguments to be accessed by reference, as in
>
> function myfunct(&$foobar)
>
> Also, global variables can be used to minimize stack manipulation.
It's worth noting that references tend to cause more data copying. When
a referenced variable is passed by value, copy-on-write occurs. When a
"copy" of a value is passed by value, it does not unless the function
called modifies its parameters.
Global variables used within functions are referenced in PHP 4, so the
same rules apply.
[Back to original message]
|