Re: Inconsistencies in callable, call_user_func and direct variable calls
| From: | Levi Morrison | Date: | Tue, 20 Jan 2015 21:20:56 +0000 |
| Subject: | Re: Inconsistencies in callable, call_user_func and direct variable calls | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-80903@lists.php.net to get a copy of this message | ||
On Tue, Jan 20, 2015 at 1:59 PM, Adam Harvey <aharvey@php.net> wrote:
> On 20 January 2015 at 12:54, Marc Bennewitz <dev@mabe.berlin> wrote:
>> valid for call_user_func[_array] and callable type-hint but invalid for for
>> direct variable calls:
>> - string "MyClass::staticFunc"
>> - string "self::staticFunc"
>> - string "static::staticFunc"
>> - string "parent::func"
>> - string "parent::staticFunc"
>>
>> see http://3v4l.org/1oSO3
>>
>> Thoughts ?
>
> This is https://bugs.php.net/bug.php?id=68475 — Julien and I
> both have
> PoC branches implementing this, and agree that it should be fixed in
> PHP 7, although I think we differ on whether an RFC is required or
> not.
If
is_callable($f) returns true then it's a bug if you can't
call
it with $f(...$args). That's my opinion anyway. I was actually made
aware of this bug some time ago but whenever I intended to fix it I
couldn't remember which case was the issue.