Re: Re: Reference Notice
| From: | Andrey Nikolaev | Date: | Wed, 20 Jul 2005 14:56:37 +0000 |
| Subject: | Re: Re: Reference Notice | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-17346@lists.php.net to get a copy of this message | ||
Derick Rethans wrote:
> 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
>
That's not a point, i'm telling about "return null".
However "return & new B" is also not allowed...