Hi Walt:This also fails when you do
On Thu, Nov 13, 2003 at 10:22:31AM -0800, walt boring wrote:
This 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.
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.
Walt