Fix inconsistency in true/false/null constant resolution when opcache is not used (#7441) Strangely, uses of eval and 'php -a' (or loading a file without opcache after a namespaced constant
Fix inconsistency in true/false/null constant resolution when opcache is not used (#7441) Strangely, uses of eval and 'php -a' (or loading a file without opcache after a namespaced constant was declared) will not treat non-FQ true/false/null as magic keywords, while compiled php required from a file would do that. This may confuse people learning the language, and result in code loaded with eval() behaving differently from the same snippet in a file loaded by require. ``` Interactive shell php > define('foo\true', 'test'); php > namespace foo { var_dump(true); } string(4) "test" ``` This will make the same session instead properly emit `bool(true);` like it already would if running those statements in files when opcache was used. (cherry picked from commit 4c48fd22d7c02913cb9ebb1c578d6cb84b8aab5f)
show more ...
|