Re: [VOTE] First-class callable syntax

From: Date: Mon, 05 Jul 2021 14:35:41 +0000
Subject: Re: [VOTE] First-class callable syntax
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-115303@lists.php.net to get a copy of this message
On Mon, Jul 5, 2021 at 4:14 PM Sara Golemon <pollita@php.net> wrote: > On Fri, Jul 2, 2021 at 5:51 AM Nikita Popov <nikita.ppv@gmail.com> 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 function >> application. Should it not be accepted, I'll explore alternative syntax >> possibilities. >> >> > Was replying to a comment on reddit which made me look closer at your > implementation. It looks like this does NOT allow for use of function-like > language constructs. > e.g. $e = echo(...); $p = print(...); $r = require(...); // etc... > > 1/ Is this intentional? > Yes. > 2/ Is this actually a good thing? > Yes. echo is not a function, so you can't acquire a callable to it. 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 :) Regards, Nikita

« previous php.internals (#115303) next »