xref: /php-src/ext/opcache/tests/bug77058.phpt (revision d8696f92)
1--TEST--
2Bug #77058: Type inference in opcache causes side effects
3--EXTENSIONS--
4opcache
5--FILE--
6<?php
7
8function myfunc(){
9  $Nr = 0;
10  while(1){
11    $x--;
12    $x++;
13    if( ++ $Nr >= 2 ) break;
14  }
15  echo "'$Nr' is expected to be 2", PHP_EOL;
16}
17myfunc();
18
19?>
20--EXPECTF--
21Warning: Undefined variable $x in %s on line %d
22
23Warning: Decrement on type null has no effect, this will change in the next major version of PHP in %s on line %d
24'2' is expected to be 2
25