phpstan-src icon indicating copy to clipboard operation
phpstan-src copied to clipboard

Revert "Cleanup `instanceof Type` checks"

Open takaram opened this issue 2 months ago • 3 comments

This partially reverts 3b72271648184ebc0cc3fa215ac355e6315f10cc (#4380).

Closes phpstan/phpstan#13694

takaram avatar Oct 19 '25 19:10 takaram

looks like this fix regresses https://github.com/phpstan/phpstan/issues/8372 which was fixed recently see https://github.com/phpstan/phpstan-src/actions/runs/18634779784#summary-53124523776

staabm avatar Oct 19 '25 19:10 staabm

@staabm Was it really fixed? I tested on latest 2.1.x and still see the error Cannot access an offset on mixed.

takaram avatar Oct 23 '25 10:10 takaram

Was it really fixed?

hmm seems you are right. even on the latest dev-2.1.x it does not look fixed. maybe a issue-bot bug then.

➜  phpstan-src git:(2.1.x) ✗ php bin/phpstan analyze test.php --debug   --level=10
Xdebug: [Step Debug] Could not connect to debugging client. Tried: localhost:9003 (through xdebug.client_host/xdebug.client_port).

 ! [NOTE] The Xdebug PHP extension is active, but "--xdebug" is not used.                                               
 !        The process was restarted and it will not halt at breakpoints.                                                
 !        Use "--xdebug" if you want to halt at breakpoints.                                                            

Note: Using configuration file /Users/m.staab/dvl/phpstan-src/phpstan.neon.dist.
/Users/m.staab/dvl/phpstan-src/test.php
 ------ --------------------------------------- 
  Line   test.php                               
 ------ --------------------------------------- 
  2      Class Test must be abstract or final.  
         🪪  phpstan.finalClass                 
         at test.php:2                          
  21     Cannot access an offset on mixed.      
         🪪  offsetAccess.nonOffsetAccessible   
         at test.php:21                         
  22     Cannot access an offset on mixed.      
         🪪  offsetAccess.nonOffsetAccessible   
         at test.php:22                         
 ------ --------------------------------------- 

staabm avatar Oct 23 '25 11:10 staabm