File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed
Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -688,7 +688,7 @@ public function processAssignVar(
688688 $ throwPoints = array_merge ($ throwPoints , $ keyResult ->getThrowPoints ());
689689 $ impurePoints = array_merge ($ impurePoints , $ keyResult ->getImpurePoints ());
690690 $ isAlwaysTerminating = $ isAlwaysTerminating || $ keyResult ->isAlwaysTerminating ();
691- // no need for $keyResult->getScope()
691+ $ scope = $ keyResult ->getScope ();
692692 }
693693
694694 if ($ arrayItem ->key === null ) {
Original file line number Diff line number Diff line change 1+ <?php declare (strict_types = 1 );
2+
3+ namespace Bug14019 ;
4+
5+ use function PHPStan \Testing \assertType ;
6+
7+ [($ a = 'foo ' ) => $ b ] = ['foo ' => 1 ];
8+
9+ assertType ("'foo' " , $ a );
10+ assertType ('1 ' , $ b );
Original file line number Diff line number Diff line change @@ -1393,6 +1393,16 @@ public function testBug6830(): void
13931393 $ this ->analyse ([__DIR__ . '/data/bug-6830.php ' ], []);
13941394 }
13951395
1396+ public function testBug14019 (): void
1397+ {
1398+ $ this ->cliArgumentsVariablesRegistered = true ;
1399+ $ this ->polluteScopeWithLoopInitialAssignments = false ;
1400+ $ this ->checkMaybeUndefinedVariables = true ;
1401+ $ this ->polluteScopeWithAlwaysIterableForeach = true ;
1402+
1403+ $ this ->analyse ([__DIR__ . '/../../Analyser/nsrt/bug-14019.php ' ], []);
1404+ }
1405+
13961406 public function testBug14117 (): void
13971407 {
13981408 $ this ->cliArgumentsVariablesRegistered = true ;
You can’t perform that action at this time.
0 commit comments