Re: Re: Reference Notice

From: Date: Wed, 20 Jul 2005 12:08:18 +0000
Subject: Re: Re: Reference Notice
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-17343@lists.php.net to get a copy of this message
On Wed, 20 Jul 2005, Andrey Nikolaev wrote: > function &a() { > if(1==2) > return new B; //some reference... > else > return null; //error, we cant create B > } > $b_instance = a(); > ?> Why are you returning by reference in the first place here? "new B" already creates a copy. Derick -- Derick Rethans http://derickrethans.nl | http://ez.no | http://xdebug.org

« previous php.internals (#17343) next »