Closed theo1024 closed 8 years ago
That looks a lot cleaner. I'm OK with this, what about you @foglcz?
I'm still not clear exactly what error this is solving. The example you linked talks about return $foo = &$bar
which we're not doing. This is pretty much a straight return of a scalar, so it shouldn't result in any error.
Yes I found it today after upgrade to PHP 5.6.18 (PHP 5.6.18-pl0-gentoo).
Can you give me the exact PHP error? Also, how are you calling it to generate the error? I want to see if I can recreate it.
Yeah, this is an edge case in PHP 5.6+, this code throws notice there without it.
Original: https://github.com/foglcz/JSONRpc2/pull/14 Essentially this problem -> https://stackoverflow.com/questions/28348879/only-variable-references-should-be-returned-by-reference-codeigniter
It seems that in PHP 5.6 changed the way the variable reference are returned from methods. This small change repair it. Some details are available on Stack Overflow.