File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed 
tests/PHPStan/Analyser/nsrt Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -17,9 +17,10 @@ function doFoo()
1717
1818/** 
1919 * @param array<1|2|3, 4|5|6> $unionKeyedArray 
20+  * @param 4|5 $fourOrFive 
2021 * @return void 
2122 */ 
22- function  doFooStrings ($ unionKeyedArray ) {
23+ function  doFooStrings ($ unionKeyedArray,  $ fourOrFive  ) {
2324	$ a  = [2  => 'hi ' , 3  => '123 ' , 'xy '  => 5 ];
2425	$ keys  = array_keys ($ a , 1 );
2526	assertType ("list<2|3|'xy'> " , $ keys );
@@ -30,6 +31,12 @@ function doFooStrings($unionKeyedArray) {
3031	$ keys  = array_keys ($ unionKeyedArray , 1 );
3132	assertType ("list<1|2|3> " , $ keys ); // could be array{} 
3233
34+ 	$ keys  = array_keys ($ unionKeyedArray , 4 );
35+ 	assertType ("list<1|2|3> " , $ keys );
36+ 
37+ 	$ keys  = array_keys ($ unionKeyedArray , $ fourOrFive );
38+ 	assertType ("list<1|2|3> " , $ keys );
39+ 
3340	$ keys  = array_keys ($ unionKeyedArray );
3441	assertType ("list<1|2|3> " , $ keys );
3542}
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments