Bug report
since PHP8 array_key_exists throws a TypeError for non-array values.
Code snippet that reproduces the problem
https://phpstan.org/r/41c83001-c84e-49fb-9c19-7b6c8428af0b
Expected output
IMO this means in the !array_key_exists-case we can narrow $mixed to array (like we do for array-typed arguments).
at best our ArrayType would be subtractable and lead to array~hasOffset('a') - buts thats not implemented atm.
atm we use mixed~hasOffset('a')
Did PHPStan help you today? Did it make you happy in any way?
No response
Bug report
since PHP8
array_key_existsthrows aTypeErrorfor non-array values.Code snippet that reproduces the problem
https://phpstan.org/r/41c83001-c84e-49fb-9c19-7b6c8428af0b
Expected output
IMO this means in the
!array_key_exists-case we can narrow$mixedtoarray(like we do for array-typed arguments).at best our ArrayType would be subtractable and lead to
array~hasOffset('a')- buts thats not implemented atm.atm we use
mixed~hasOffset('a')Did PHPStan help you today? Did it make you happy in any way?
No response