Re: Changing fundamental language behaviors
| From: | Matthew Brown | Date: | Thu, 12 Sep 2019 18:25:09 +0000 |
| Subject: | Re: Changing fundamental language behaviors | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-107003@lists.php.net to get a copy of this message | ||
I'm sure that some people wrote code like this, expecting it to always work
in PHP:
if ($some_condition) define("HELLO", 0);
if (HELLO) { var_dump("got here"); }
The equivalent, relying on buggy behaviour, PHP code looks like
if ($some_condition) $hello = 1;
if (!$hello) { var_dump("got here"); }
If preventing undefined constants wasn't a fundamental change to the
language, neither is preventing undefined variables.
>