Re: [RFC] Transform exit() from a language construct into a standard function
| From: | Gina P. Banyard | Date: | Sat, 11 May 2024 14:43:19 +0000 |
| Subject: | Re: [RFC] Transform exit() from a language construct into a standard function | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-123310@lists.php.net to get a copy of this message | ||
On Thursday, 9 May 2024 at 15:17, Jorg Sowa <jorg.sowa@gmail.com> wrote:
>> I don't think there are any other "functions" like this.
> What about list(), isset(), print(), echo(), require(), include(), unset(), empty()? We use
> them the same way as functions, but those are not real functions.
> Kind regards,
> Jorg
list() (and array()) may look like functions but do not behave like one as they affect the current
scope by setting various variables.
isset()/empty()/unset() require to work with undefined variables and have deeply ingrained behaviour
within the engine, so making them simple functions is not as much of a "trivial" change.
print, echo, include(_once) and require(_once) do not mandate their "argument" to be
passed within parenthethis, so making them functions does not simplify the lexer/parser nor removes
them as keywords.
Also I don't know the last time I've used those language constructs "like a
function".
Hope this clarifies things.
Best regards,
Gina P. Banyard