On 19/03/2015 20:50, Yasuo Ohgaki wrote:
Hi Sebastian,

On Thu, Mar 19, 2015 at 9:48 PM, Sebastian B.-Hagensen <sbj.ml.r...@gmail.com <mailto:sbj.ml.r...@gmail.com>> wrote:

    2015-03-19 12:51 GMT+01:00 Yasuo Ohgaki <yohg...@ohgaki.net
    <mailto:yohg...@ohgaki.net>>:
    > Distinguishing array and callable is problematic.
    > Array callable is better to be deprecated in the long run. IMHO.

    Then how would you write an callback containing an already
    constructed object?
    $a = [$object, 'method'];

    The alternative is unnecessarily cumbersome:
    $a = function($methodArg1, $methodArg2) use($object) { return
    $object->method($methodArg1, $methodArg2); };


I'm not proposing deprecate it soon, but in the long run.
It will need a decade to deprecate it.

It is not time that is needed, but an alternative way of expressing "use this instance method as a callback", such as those discussed elsewhere in the thread.

Regards,

--
Rowan Collins
[IMSoP]


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

Reply via email to