Re: [PHP-DEV] [VOTE] First-class callable syntax

2021-07-07 Thread Levi Morrison via internals
On Wed, Jul 7, 2021 at 2:40 PM Ralph Schindler wrote: > > > > > > > It would theoretically be: > > > > $fn = MyController::myAction(...); > > > > It currently errors: > > > >> Fatal error: Uncaught Error: Non-static method MyController::myAction() > >> cannot be called statically > > > > I w

Re: [PHP-DEV] [VOTE] First-class callable syntax

2021-07-07 Thread Nikita Popov
On Wed, Jul 7, 2021 at 10:41 PM Ralph Schindler wrote: > > > > > > It would theoretically be: > > > > $fn = MyController::myAction(...); > > > > It currently errors: > > > >> Fatal error: Uncaught Error: Non-static method MyController::myAction() > cannot be called statically > > > > I would

Re: [PHP-DEV] [VOTE] First-class callable syntax

2021-07-07 Thread Ralph Schindler
It would theoretically be: $fn = MyController::myAction(...); It currently errors: Fatal error: Uncaught Error: Non-static method MyController::myAction() cannot be called statically I would be okay with allowing this, as long as it's bound before it's called. Could we do this f

Re: [PHP-DEV] [VOTE] First-class callable syntax

2021-07-05 Thread Rowan Tommins
On 05/07/2021 15:35, Nikita Popov wrote: The actual echo syntax is echo "Foo". PHP allows you to write echo("Foo") in the same way it allows you to write echo("Foo"). Don't do it :) Indeed. Note that this is valid: echo "hello", " ", "world"; But this is not: echo("hello", " ", "wor

Re: [PHP-DEV] [VOTE] First-class callable syntax

2021-07-05 Thread Nikita Popov
On Mon, Jul 5, 2021 at 4:14 PM Sara Golemon wrote: > On Fri, Jul 2, 2021 at 5:51 AM Nikita Popov wrote: > >> As the partial function application RFC has not been accepted, I have >> opened voting on https://wiki.php.net/rfc/first_class_callable_syntax. >> The >> vote closes on 2021-07-16. >> >>

Re: [PHP-DEV] [VOTE] First-class callable syntax

2021-07-05 Thread Sara Golemon
On Fri, Jul 2, 2021 at 5:51 AM Nikita Popov wrote: > As the partial function application RFC has not been accepted, I have > opened voting on https://wiki.php.net/rfc/first_class_callable_syntax. The > vote closes on 2021-07-16. > > This RFC uses a syntax that is forward-compatible with partial f

Re: [PHP-DEV] [VOTE] First-class callable syntax

2021-07-03 Thread Nikita Popov
On Sat, Jul 3, 2021 at 3:51 PM Ralph Schindler wrote: > > > It would theoretically be: > > > > $fn = MyController::myAction(...); > > > > It currently errors: > > > >> Fatal error: Uncaught Error: Non-static method MyController::myAction() > cannot be called statically > > > > I would be oka

Re: [PHP-DEV] [VOTE] First-class callable syntax

2021-07-03 Thread Ralph Schindler
It would theoretically be: $fn = MyController::myAction(...); It currently errors: Fatal error: Uncaught Error: Non-static method MyController::myAction() cannot be called statically I would be okay with allowing this, as long as it's bound before it's called. One other question

Re: [PHP-DEV] [VOTE] First-class callable syntax

2021-07-02 Thread Levi Morrison via internals
On Fri, Jul 2, 2021 at 10:32 AM Ralph Schindler wrote: > > > > This RFC uses a syntax that is forward-compatible with partial function > > application. Should it not be accepted, I'll explore alternative syntax > > possibilities. > > Given the choice of syntax in this proposal (which I do like)...

Re: [PHP-DEV] [VOTE] First-class callable syntax

2021-07-02 Thread Ralph Schindler
This RFC uses a syntax that is forward-compatible with partial function application. Should it not be accepted, I'll explore alternative syntax possibilities. Given the choice of syntax in this proposal (which I do like)... Is the following (potentially future) use case precluded by the synt