mirror of
https://github.com/php/php-src.git
synced 2024-11-23 18:04:36 +08:00
249e49092d
The "return" in the for loop should have been a break on the switch, otherwise the result is just ignored... but because it prevents evaluation of the other operand, it also violates the invariant that everything has been constant evaluated, resulting in an assertion failure. The for loop isn't correct in any case though, because it's not legal to determine the result based on just the second operand, as the first one may have a side-effect that cannot be optimized away.
10 lines
151 B
PHP
10 lines
151 B
PHP
--TEST--
|
|
Incorrect constant evaluation of and/or (OSS-Fuzz #19255)
|
|
--FILE--
|
|
<?php
|
|
const C = 0 && __namespace__;
|
|
var_dump(C);
|
|
?>
|
|
--EXPECT--
|
|
bool(false)
|