On 6 Aug 2014, at 16:01, Ralph Schindler <ra...@ralphschindler.com> wrote:

> When you put it like this, that further enhances my argument for adding
> a call() and/or a bindCall().  Having to rely on __invoke() means
> you're coding around and relying on an implementation detail, as opposed
> to the class's published API.

__invoke *is* in the published API, it’s just not seen properly by Reflection 
or the docs. Yes, internally it’s implemented weirdly, but it is part of the 
API proper.

> It would be nice to be able to call closure in an object oriented way,
> in addition to the language-level call $func() and the
> functional/procedural way to call it call_user_func($func), after all, at 
> current it seems OO-isms are more rampant in PHP than other programming 
> paradigms.

Use () or __invoke(). Unfortunately you can’t do ->foo()() just now, sure, but 
I believe Nikita’s Uniform Variable Syntax fixes that, so it’s not a problem. 
->call doesn’t cater to this use case.
--
Andrea Faulds
http://ajf.me/





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

Reply via email to