return NULL by reference

From: Date: Mon, 27 Sep 2004 17:52:24 +0000
Subject: return NULL by reference
Groups: php.internals 
Request: Send a blank email to internals+get-13017@lists.php.net to get a copy of this message
I can't seem to reproduce this bug, I was wondering if anyone has any input they could give me.... I wrote a function to return a parameter by reference that worked with PHP5.0 RC1, looks like this: function & getParameter ($name) { if (isset($this->params[$name])) { return $this->params[$name]; } return NULL; } Now I recently upgraded to PHP5.0.2 and I get errors. I have tried to make a test case script to demonstrate it but it works fine in command line. My cgi script is huge, so I can't tell you how to reproduce it, but it's giving me this error: "Only variable references should be returned by reference " on the line with "return NULL;". Could this be related to another bug? The code works fine if I replace "return NULL" with anything else, even "return $nonexistant->variable;". Is there a way I can turn this check off? -Jeff Moss

« previous php.internals (#13017) next »