bug77058.phpt 346 B

12345678910111213141516171819202122
  1. --TEST--
  2. Bug #77058: Type inference in opcache causes side effects
  3. --EXTENSIONS--
  4. opcache
  5. --FILE--
  6. <?php
  7. function myfunc(){
  8. $Nr = 0;
  9. while(1){
  10. $x--;
  11. $x++;
  12. if( ++ $Nr >= 2 ) break;
  13. }
  14. echo "'$Nr' is expected to be 2", PHP_EOL;
  15. }
  16. myfunc();
  17. ?>
  18. --EXPECTF--
  19. Warning: Undefined variable $x in %s on line %d
  20. '2' is expected to be 2