Re: return NULL by reference

From: Date: Mon, 27 Sep 2004 18:33:54 +0000
Subject: Re: return NULL by reference
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-13021@lists.php.net to get a copy of this message
Well I can't reliably reproduce it, is this expected behavior or not? If there is a cleaner solution I'd like to try that first. I'd like to turn off this error altogether even if I have to patch and recompile. I can't see anything like this in the changelogs. Since when should anything not be allowed to return null? -Jeff ----- Original Message ----- From: "Daniel Convissor" <danielc@analysisandsolutions.com> To: "Jeffrey Moss" <jeff@opendbms.com> Cc: <internals@lists.php.net> Sent: Monday, September 27, 2004 12:04 PM Subject: Re: [PHP-DEV] return NULL by reference > On Mon, Sep 27, 2004 at 11:52:24AM -0600, Jeffrey Moss wrote: > > > return NULL; > ... snip ... > > "Only variable references should be returned by reference " > > Just like the error message says. "References" are referring to > variables. NULL isn't a variable. Do this instead: > > $tmp = null; > return $tmp; > > --Dan > > -- > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > data intensive web and database programming > http://www.AnalysisAndSolutions.com/ > 4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409

« previous php.internals (#13021) next »