File tree Expand file tree Collapse file tree
tests/PHPStan/Rules/Properties Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1183,6 +1183,14 @@ public function testBug11289(): void
11831183 $ this ->analyse ([__DIR__ . '/data/bug-11289.php ' ], []);
11841184 }
11851185
1186+ public function testBug9120 (): void
1187+ {
1188+ $ this ->checkThisOnly = false ;
1189+ $ this ->checkUnionTypes = true ;
1190+ $ this ->checkDynamicProperties = false ;
1191+ $ this ->analyse ([__DIR__ . '/data/bug-9120.php ' ], []);
1192+ }
1193+
11861194 public function testBug8668 (): void
11871195 {
11881196 $ this ->checkThisOnly = false ;
Original file line number Diff line number Diff line change 1+ <?php declare (strict_types = 1 );
2+
3+ namespace Bug9120 ;
4+
5+ function do_something (): void
6+ {
7+ $ db = new \PDO ('connection-string ' );
8+
9+ $ statement = $ db ->query ('sql-query ' );
10+ if ($ statement !== false )
11+ {
12+ $ statement ->setFetchMode (\PDO ::FETCH_OBJ );
13+
14+ foreach ($ statement as $ tmpObject )
15+ {
16+ echo $ tmpObject ->mycolumn ;
17+ }
18+ }
19+ }
You can’t perform that action at this time.
0 commit comments