Posted by Ryan Lange on 05/14/06 20:11
howachen@gmail.com wrote:
> if this instance use a lot of memory, would it be better if i use
> reference?
>
> e.g.
>
> //*********************
> public static function &singleton()
> {
> if (!isset(self::$instance)) {
> $c = __CLASS__;
> self::$instance = new $c;
> }
>
> return self::$instance;
> }
> //*********************
By default, objects in PHP5 are passed/returned by reference, so
this is unnecessary.
Ryan
[Back to original message]
|