Re: BC break: ReflectionMethod::invoke() expects parameter1to be object, string given
| From: | Alexander Lisachenko | Date: | Tue, 23 Aug 2016 13:56:47 +0000 |
| Subject: | Re: BC break: ReflectionMethod::invoke() expects parameter1to be object, string given | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-95412@lists.php.net to get a copy of this message | ||
2016-08-23 16:40 GMT+03:00 Julien Pauli <jpauli@php.net>:
> My patch allows that, but I can't find a use case to it.
My use case for that was decorating of static methods with additional
behaviour, so it's possible to cache the result of static methods, etc.
Unfortunately, reflection API doesn't provide me such an ability, so I
decided to switch to the combination of special closure with
forward_static_call_array() and binding it to the desired scope.
2016-08-23 16:40 GMT+03:00 Julien Pauli <jpauli@php.net>:
> Try it.
Yes, sure, I will check. However as I say earlier, now I use closure
extraction and scope binding as more natural way to invoke such methods. So
missing scope argument for static methods and ReflectionMethod->invoke() is
a nice thing to have, but not a critical one.