The negative range inference implementation does not work correctly,
and it's not clear right now how it can be fixed. As such, disable
it entirely for now.
#define SYM_RANGE
/* Whether to handle negative range constraints */
-#define NEG_RANGE
+/* Negative range inference is buggy, so disabled for now */
+#undef NEG_RANGE
/* Number of warmup passes to use prior to widening */
#define RANGE_WARMUP_PASSES 16
--- /dev/null
+--TEST--
+Incorrect negative range inference
+--FILE--
+<?php
+
+function test() {
+ for ($i = 0; $i < 10; $i++) {
+ if ($i != 5) {
+ $t = (int) ($i < 5);
+ var_dump($t);
+ }
+ }
+}
+test();
+
+?>
+--EXPECT--
+int(1)
+int(1)
+int(1)
+int(1)
+int(1)
+int(0)
+int(0)
+int(0)
+int(0)