Feature request
https://3v4l.org/b3Vem
As we can see here, there are two types of isOffsetAccessible->no. Whether it throws a fatal error in isset/coalesce/empty ($scope->isUndefinedExpressionAllowed) or not.
I think we can improve NonexistentOffsetInArrayDimFetchRule by separating these.
Also, a lot of people are not aware why StrictMixedType throws an error with the code below, maybe we can add some information in the document
/** @var mixed $mixed */
isset($mixed['foo']);
Goal
https://phpstan.org/r/1087a148-ae5b-477f-9003-215fefc3437f
No error in line 7, 21
Throw error in 12
Design
- Add method something like
isOffsetAccessThrowsFatalError(): TernaryLogic (want a better naming...) to Types
- Return TernaryLogic::Yes for
isOffsetAccessThrowsFatalError in MixedType/StrictMixedType if object type is subtracted
Related issues
These issues should be closed after documented
The test should be reverted after this is implemented
Array access with json_decode mixed problems
Did PHPStan help you today? Did it make you happy in any way?
PHPStan on PHPStan finds error while developing PHPStan 😄
Feature request
https://3v4l.org/b3Vem
As we can see here, there are two types of
isOffsetAccessible->no. Whether it throws a fatal error in isset/coalesce/empty ($scope->isUndefinedExpressionAllowed) or not.I think we can improve
NonexistentOffsetInArrayDimFetchRuleby separating these.Also, a lot of people are not aware why
StrictMixedTypethrows an error with the code below, maybe we can add some information in the documentGoal
https://phpstan.org/r/1087a148-ae5b-477f-9003-215fefc3437f
No error in line 7, 21
Throw error in 12
Design
isOffsetAccessThrowsFatalError(): TernaryLogic(want a better naming...) to TypesisOffsetAccessThrowsFatalErrorin MixedType/StrictMixedType if object type is subtractedRelated issues
These issues should be closed after documented
isset()#8388The test should be reverted after this is implemented
Array access with
json_decodemixed problemsjson_decodedefault return type phpstan-src#1283Did PHPStan help you today? Did it make you happy in any way?
PHPStan on PHPStan finds error while developing PHPStan 😄