Re: [PHP-DEV] [Pre-RFC] Convert exit (and die) from language constructs to functions

2024-02-27 Thread Claude Pache
> > I hear you, but what about exit; ?! > Do not worry exit; is still supported! > It only requires a _tiny_ bit of dark magic to achieve this! > exit; would just be interpreted as a fetch to a constant, > so when attempting to access the undefined exit/die case-insensitive constant > we just

Re: [PHP-DEV] [Pre-RFC] Convert exit (and die) from language constructs to functions

2024-02-24 Thread Gina P. Banyard
On Saturday, 24 February 2024 at 11:46, Kamil Tekiela wrote: > I would actually be against this change. It's a language construct for > a reason. Functions can be disabled and overridden, but language > constructs cannot. Exit is supposed to end the script execution > without any hidden quirks.

Re: [PHP-DEV] [Pre-RFC] Convert exit (and die) from language constructs to functions

2024-02-23 Thread Juliette Reinders Folmer
On 24-2-2024 3:47, Gina P. Banyard wrote: On Saturday, 24 February 2024 at 01:57, Juliette Reinders Folmer wrote: Hi Gina, I'm not sure a pet-peeve is a good motivation for creating an (I expect large) breaking change. The upgrade path, I suppose, would be updating calls to

Re: [PHP-DEV] [Pre-RFC] Convert exit (and die) from language constructs to functions

2024-02-23 Thread Gina P. Banyard
On Saturday, 24 February 2024 at 01:57, Juliette Reinders Folmer wrote: > Hi Gina, > > I'm not sure a pet-peeve is a good motivation for creating an (I expect > large) breaking change. > > The upgrade path, I suppose, would be updating calls to `die`/`exit` to > always have parentheses ? Or

Re: [PHP-DEV] [Pre-RFC] Convert exit (and die) from language constructs to functions

2024-02-23 Thread Juliette Reinders Folmer
On 24-2-2024 2:37, Gina P. Banyard wrote: Hello internals, I've been having this mild annoyance with exit()/die() since I wrote a CLI script using a boolean $hasErrors variable to know if the script failed or not and to indicate if the script failed via a non-zero status code by doing: