xref: /PHP-8.2/ext/opcache/tests/bug77058.phpt (revision e9f783fc)
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'2' is expected to be 2
23