Re: [RFC] Transform exit() from a language construct into a standard function
| From: | Ilija Tovilo | Date: | Mon, 27 May 2024 01:31:28 +0000 |
| Subject: | Re: [RFC] Transform exit() from a language construct into a standard function | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-123432@lists.php.net to get a copy of this message | ||
Hi Gina
On Sun, May 26, 2024 at 11:47 PM Gina P. Banyard <internals@gpb.moe> wrote:
>
> On Wednesday, 8 May 2024 at 14:40, Gina P. Banyard <internals@gpb.moe> wrote:
>
> >
> > I would like to formally propose my idea for exit() as a function brought up to the list
> > on 2024-02-24 [1] with the following RFC:
> > https://wiki.php.net/rfc/exit-as-function
>
> As there haven't been any comments for nearly two weeks, I'm planning on opening the
> vote for the RFC on Tuesday.
As mentioned early on in private, I don't see a convincing reason to
remove tokenizer/parser support for exit/die. I'd rather see this
handled in the parser directly, by converting the standalone keywords
to function calls. This avoids any backwards incompatibility, and
avoids special handling in zend_compile_const.
Another thing that's probably not too important: The PR likely breaks
dead code elimination for exit() and die(). This could be re-added by
checking for the never return type instead. You'd also need to
special-case the lookup of exit/die in namespaced code, where it will
always refer to the global function (as they cannot be declared in
userland).
Ilija