foglcz / JSONRpc2

Generic JSON-RPC v2 implementation
Other
19 stars 10 forks source link

Bugfix: Added compatibility with PHP 5.6 #15

Closed theo1024 closed 8 years ago

theo1024 commented 8 years ago

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.

scottchiefbaker commented 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.

theo1024 commented 8 years ago

Yes I found it today after upgrade to PHP 5.6.18 (PHP 5.6.18-pl0-gentoo).

scottchiefbaker commented 8 years ago

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.

foglcz commented 8 years ago

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