Re: [RFC] Transform exit() from a language construct into a standard function
| From: | Juliette Reinders Folmer | Date: | Tue, 14 May 2024 16:24:20 +0000 |
| Subject: | Re: [RFC] Transform exit() from a language construct into a standard function | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-123318@lists.php.net to get a copy of this message | ||
On 11-5-2024 16:43, Gina P. Banyard wrote:
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.Seeing this list, makes me wonder: what about eval() ?What about list(), isset(), print(), echo(), require(), include(), unset(), empty()? We use them the same way as functions, but those are not real functions.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".