Re: php5 method return reference error?
| From: | walt boring | Date: | Thu, 13 Nov 2003 18:48:26 +0000 |
| Subject: | Re: php5 method return reference error? | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-5443@lists.php.net to get a copy of this message | ||
Analysis & Solutions wrote:
Hi Walt: On Thu, Nov 13, 2003 at 10:22:31AM -0800, walt boring wrote:function &foo() { return new bar(); } the something_else() function in my first example could return a variable. function &foo() { return something_else(); } function &something_else() { $foo = 'a'; return $foo; } This also fails, and it shouldn't. WaltThis is very sad that the only real argument in the bug against fixing it was that it was hard. Come on! This is such a fundamental thing to be able to do. function &foo() { return something_else(); }The thing is, as I understand it, references are referring to a variable. Your example doesn't have a variable to refer to. If I misunderstand what's going on, I trust someone on the list will correct me.going to make a lot of php folks upset, and make it much more painfull to upgrade to php5.But the error rests on the people who made the mistake of coding returns by reference on items that aren't variables. This also fails when you do