At 17:06 06/03/2005, Derick Rethans wrote:
>On Sun, 6 Mar 2005, Zeev Suraski wrote:
>
> > At 06:47 06/03/2005, Yermo Lamers wrote:
> >
> > >What is the proper way to return a NULL condition from a method that
> > >returns a reference?
> > >
> > >function &testfunc()
> > >{
> > >return NULL;
> > >}
> > >
> > >generates:
> > >
> > >"Strict Standards: Only variable references should be returned by
> > >reference in ..."
> > >
> > >Is the correct approach to do something like:
> > >
> > >function &testfunc()
> > >{
> > >$nullVar = NULL;
> > >return $nullVar;
> > >}
> >
> > That'd work, yep.
>
>Wrong ;-) It causes problems with reference counting - and will segfault
>PHP after some time.
Hmm, that in itself shouldn't cause any problems unless it's coupled with
something else that's causing problems... Not that it helps you any if you
end up bumping into problems :)
Zeev