php-src/Zend/tests/unreachable_phi_cycle.phpt
George Peter Banyard d8696f9216
[RFC] Path to Saner Increment/Decrement operators (#10358)
* Add behavioural tests for incdec operators

* Add support to ++/-- for objects castable to _IS_NUMBER

* Add str_increment() function

* Add str_decrement() function

RFC: https://wiki.php.net/rfc/saner-inc-dec-operators

Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
Co-authored-by: Arnaud Le Blanc <arnaud.lb@gmail.com>
2023-07-17 15:51:24 +01:00

18 lines
429 B
PHP

--TEST--
Unreachable phi cycle
--FILE--
<?php
// The inner loop is dead, but SCCP reachability analysis doesn't realize this,
// as this is determined based on type information.
function test() {
for (; $i--;) {
for(; x;);
}
}
test();
?>
--EXPECTF--
Warning: Undefined variable $i in %s on line %d
Warning: Decrement on type null has no effect, this will change in the next major version of PHP in %s on line %d