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 h
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
And another situation...
And we got Notice...
Notice: Only variable references should be returned by reference in - on line 6
But if we modify code to:
Than all ok, no notices, and i got what i want... but it's a kludge :-/
--
PHP Internals - PHP Runtime Development Mailing List
To unsubsc