On 08/03/2015 01:25, Yasuo Ohgaki wrote:
Hi Rowan,

On Sun, Mar 8, 2015 at 8:31 AM, Rowan Collins <rowan.coll...@gmail.com <mailto:rowan.coll...@gmail.com>> wrote:

    What? That's not the same thing at all. I'm pretty sure those
    functions are deprecated *because* we have array callback forms,
    so you can use call_user_func to call a method.

    PHP has a well-defined definition of "callable", as used by
    is_callable() and function parameter typehints, and literally
    everywhere that wants a callback. Since there's no such thing as a
    function or method pointer, that definition includes a string
    identifying a plain function, and two array forms, [string,
    string] and [object, string], representing static and instance
    methods, respectively. You can't not accept those forms as a
    callback parameter in one particular function just to make things
    tidier.


I should have written "Let deprecate _all_ array callbacks" by document and raise deprecate error in PHP7.
Remove array callbacks in PHP 8.


In favour of what? We have no other way of telling a function expecting a callback to use an existing method.

And why? Because one particular function signature you want to create would be possible if "array" and "callback" were non-overlapping type hints? Is there something wrong with having a function that explicitly tells people it takes callbacks, rather than guessing based on the arguments you pass in?

Regards,

--
Rowan Collins
[IMSoP]


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to