On 20/05/2021 12:55, Guilliam Xavier wrote:
On Thu, May 20, 2021 at 5:12 PM Nikita Popov <nikita....@gmail.com> wrote:

On Thu, May 20, 2021 at 4:16 PM Ondřej Mirtes <ond...@mirtes.cz> wrote:

Hi, I’m confused by the syntax, when I read it, I think to myself “I know
this, this is just a method call… oh wait, it’s actually a callable”. It
really makes my head hurt.


Yes, I can see how that could be confusing. The current syntax is chosen to
be a subset of the partial function application proposal. However, I would
also be happy with some other syntax that makes it clearer that this is
acquiring a callable and not performing a call.


Hi, several other syntaxes have been proposed to consideration in the PFA
thread, and I wouldn't want to start new bikeshedding here; is there a
place that would be more appropriate to gather the possibilities (like a
kind of updatable list)?

Thanks,


I am much more into advanced features of PFA, but is this case why not just use the & operator for "function reference" like C/C++? It is well known and solves the ambiguity with method/function call.

$fn = &$this->myFunc;

$fn = &myFunc;

$fn = &Foo::myFunc;

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

Reply via email to