xref: /PHP-8.2/ext/opcache/tests/opt/dce_012.phpt (revision 7b629afe)
1--TEST--
2Incorrect DCE of constructor DO_FCALL
3--FILE--
4<?php
5function test() {
6	$a = null;
7    for ($i = 0; $i < 10; $i++) {
8        $obj = $a = $a;
9        $obj = new stdClass;
10        $obj->orop1 = 'abc';
11    }
12
13    foreach (range(0, 6) as $levels) {
14        print "$levels level" . ($levels == C ? "" : "s") . "aaa";
15    }
16
17    $obj->prop1 = null;
18}
19test();
20?>
21--EXPECTF--
22Fatal error: Uncaught Error: Undefined constant "C" in %sdce_012.php:11
23Stack trace:
24#0 %sdce_012.php(16): test()
25#1 {main}
26  thrown in %sdce_012.php on line 11
27