1--TEST--
2Type inference 001: Invalid type narrowing warning
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.optimization_level=-1
7--FILE--
8<?php
9function test() {
10    $j = 0;
11    for ($i = 0; $i = 10; $i++) {
12        $e;
13        $a = $a;
14        $obj->$e;
15        $i += $a;
16        $j++;
17        $e;
18        $a == $Z + $a .= $i+= $a;
19        $j++;
20        $e;
21        $a == $Z + $j++;
22        $e;
23        $a == $Z + $a = $a + $b = $i += $a;
24        $obj = new stdClass;
25        $obj->prop1 = set_error_handler(function () {
26            $$GLOBALS['a'] = null;
27        });
28        $obj->$a .= $i += $a;
29        $obj = new stdClass;
30        $obj->prop1 = $j++;
31        $e;
32        $a == $Z + $a = $a + $j++;
33        $e;
34        $a == $Z + $a = $a + $b = $aa = $a;
35    }
36}
37test();
38?>
39DONE
40--EXPECTF--
41Warning: Undefined variable $a in %sinference_001.php on line 6
42
43Warning: Undefined variable $obj in %sinference_001.php on line 7
44
45Warning: Undefined variable $e in %sinference_001.php on line 7
46
47Warning: Attempt to read property "" on null in %sinference_001.php on line 7
48
49Warning: Undefined variable $Z in %sinference_001.php on line 11
50
51Warning: Undefined variable $Z in %sinference_001.php on line 14
52
53Warning: Undefined variable $Z in %sinference_001.php on line 16
54
55Warning: Array to string conversion in %sinference_001.php on line 19
56
57Warning: Array to string conversion in %sinference_001.php on line 19
58
59Warning: Array to string conversion in %sinference_001.php on line 19
60
61Warning: Array to string conversion in %sinference_001.php on line 19
62
63Warning: Array to string conversion in %sinference_001.php on line 19
64
65Warning: Array to string conversion in %sinference_001.php on line 19
66
67Warning: Array to string conversion in %sinference_001.php on line 19
68
69Warning: Array to string conversion in %sinference_001.php on line 19
70
71Warning: Array to string conversion in %sinference_001.php on line 19
72
73Warning: Array to string conversion in %sinference_001.php on line 19
74
75Warning: Array to string conversion in %sinference_001.php on line 19
76
77Warning: Array to string conversion in %sinference_001.php on line 19
78
79Warning: Array to string conversion in %sinference_001.php on line 19
80
81Warning: Array to string conversion in %sinference_001.php on line 19
82
83Warning: Array to string conversion in %sinference_001.php on line 19
84
85Warning: Array to string conversion in %sinference_001.php on line 19
86
87Warning: Array to string conversion in %sinference_001.php on line 19
88
89Warning: Array to string conversion in %sinference_001.php on line 19
90
91Warning: Array to string conversion in %sinference_001.php on line 19
92
93Warning: Array to string conversion in %sinference_001.php on line 19
94
95Warning: Array to string conversion in %sinference_001.php on line 19
96
97Warning: Array to string conversion in %sinference_001.php on line 19
98
99Warning: Array to string conversion in %sinference_001.php on line 19
100
101Warning: Array to string conversion in %sinference_001.php on line 19
102
103Warning: Array to string conversion in %sinference_001.php on line 19
104
105Warning: Array to string conversion in %sinference_001.php on line 19
106
107Warning: Array to string conversion in %sinference_001.php on line 19
108
109Warning: Array to string conversion in %sinference_001.php on line 19
110
111Warning: Array to string conversion in %sinference_001.php on line 19
112
113Warning: Array to string conversion in %sinference_001.php on line 19
114
115Warning: Array to string conversion in %sinference_001.php on line 19
116
117Warning: Array to string conversion in %sinference_001.php on line 19
118
119Warning: Array to string conversion in %sinference_001.php on line 19
120
121Warning: Array to string conversion in %sinference_001.php on line 19
122
123Warning: Array to string conversion in %sinference_001.php on line 19
124
125Warning: Array to string conversion in %sinference_001.php on line 19
126
127Warning: Array to string conversion in %sinference_001.php on line 19
128
129Warning: Array to string conversion in %sinference_001.php on line 19
130
131Warning: Array to string conversion in %sinference_001.php on line 19
132
133Warning: Array to string conversion in %sinference_001.php on line 19
134
135Warning: Array to string conversion in %sinference_001.php on line 19
136
137Warning: Array to string conversion in %sinference_001.php on line 19
138
139Warning: Array to string conversion in %sinference_001.php on line 19
140
141Warning: Array to string conversion in %sinference_001.php on line 19
142
143Warning: Array to string conversion in %sinference_001.php on line 19
144
145Warning: Array to string conversion in %sinference_001.php on line 19
146
147Warning: Array to string conversion in %sinference_001.php on line 19
148
149Warning: Array to string conversion in %sinference_001.php on line 19
150
151Warning: Array to string conversion in %sinference_001.php on line 19
152
153Warning: Array to string conversion in %sinference_001.php on line 19
154
155Warning: Array to string conversion in %sinference_001.php on line 19
156
157Warning: Array to string conversion in %sinference_001.php on line 19
158
159Fatal error: Uncaught TypeError: Unsupported operand types: null + string in %sinference_001.php:11
160Stack trace:
161#0 %sinference_001.php(30): test()
162#1 {main}
163  thrown in %sinference_001.php on line 11
164