"[Mystic]" <screwuspammer> wrote:
[color=blue]
> Hi
>
> I was just wondeirng how they work now, esspically regarding functions and
> return values.
>
> Do functions pass return by value or reference?
>
> Concidering the following:
>
> public static function &getInstane() {
> static $database_object; // reference object
>
> if (!is_object($database))
> $database_object = new database(); // create new object
>
> return $database_object; // return address of object
> }
>
> Do I need to return $database_object; or return &$database_object;
>
> or
>
> When calling the function:
>
> $test = &database::getInstane()
> or
> $test = database::getInstane()
>
> Thanks[/color]
PHP 5 passes by reference. As far as I know you don't need to use the &
anymore.
Rutger
--
Rutger Claes
rgc@rgc.tld
Replace tld with top level domain of belgium to contact me pgp:0x3B7D6BD6
Do not reply to the from address. It's read by /dev/null and sa-learn only