Re: PHP 5.0.3 E_STRICT question - returning NULLfrom reference returning function
| From: | sarose | Date: | Sun, 06 Mar 2005 05:39:37 +0000 |
| Subject: | Re: PHP 5.0.3 E_STRICT question - returning NULLfrom reference returning function | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-15273@lists.php.net to get a copy of this message | ||
Just curious what is the techincal aspect of the such case. Why need NULL
identifier for the return not NULL iteself.
----- Original Message -----
From: "Zeev Suraski" <zeev@zend.com>
To: <yml@dtlink.com>
Cc: <internals@lists.php.net>
Sent: Sunday, March 06, 2005 10:36 AM
Subject: Re: [PHP-DEV] PHP 5.0.3 E_STRICT question - returning NULLfrom
reference returning function
> 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.
>
> Zeev
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>