History log of /PHP-8.1/Zend/tests/eval_constant_resolution.phpt (Results 1 – 2 of 2)
Revision Date Author Comments
# 2b1b384d 03-Sep-2021 Tyson Andre

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 ...


# 4c48fd22 03-Sep-2021 Tyson Andre

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.

show more ...