Re: Deprecation of func_get_args(), call_user_func_array() and related API
| From: | Marc Bennewitz | Date: | Tue, 14 Oct 2014 03:35:03 +0000 |
| Subject: | Re: Deprecation of func_get_args(), call_user_func_array() and related API | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-77944@lists.php.net to get a copy of this message | ||
On 13.10.2014 22:26, Marco Pivetta wrote:
> On 13 October 2014 21:18, Marc Bennewitz <php@mabe.berlin
> <mailto:php@mabe.berlin>> wrote:
>
>
> On 13.10.2014 20:48, Marco Pivetta wrote:
>> On 13 October 2014 20:20, Marc Bennewitz <php@mabe.berlin
>> <mailto:php@mabe.berlin>> wrote:
>>
>>
>> On 13.10.2014 02:45, Marco Pivetta wrote:
>>
>> Your implementation of "userland_call_user_func" doesn't have
>> the same
>> visibility as "call_user_func[_array]":
>> http://3v4l.org/lNgub
>>
>>
>> Interesting: this seems to show that it's even more magic than I
>> expected.
>>
>> Here's just a hacked-together example, just to show that it can
>> be done in userland as well (there may be better ways):
>> http://3v4l.org/QuQM1#v560
> Now you have the opposite issue - you are able to call
> private/protected methods but you shouldn't:
> http://3v4l.org/rgmh8#v560
>
>
> Good catch, but I'm not trying to build a complete solution in a gist:
> if I do, then I'll just make a lib and include all existing
>
.phpt
> tests related to call_user_func, no? :-)
> Just a revision of the userland version, for fun:
> http://3v4l.org/6IKKl#v560
Sure, but it shows that it's not a simple two-liner to have a well
working solution in userland.
The more complicated it is the more error-prone it will be and btw. slow
down.
>
> Marco Pivetta
>
> http://twitter.com/Ocramius
>
> http://ocramius.github.com/