Re: PHP 5.0.3 E_STRICT question - returning NULL fromreference returning function
| From: | Yermo Lamers | Date: | Sun, 06 Mar 2005 19:23:41 +0000 |
| Subject: | Re: PHP 5.0.3 E_STRICT question - returning NULL fromreference returning function | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-15289@lists.php.net to get a copy of this message | ||
>> >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.
>
> Derick
Then what is the correct approach to handling this?
-- Yermo
----------------------------------------------------------------------------
DTLink Software http://www.dtlink.com
Desktop Software and Web Applications
----------------------------------------------------------------------------