diff --git a/tests/PHPStan/Rules/Arrays/NonexistentOffsetInArrayDimFetchRuleTest.php b/tests/PHPStan/Rules/Arrays/NonexistentOffsetInArrayDimFetchRuleTest.php index 1ddbafce4a..55afd44852 100644 --- a/tests/PHPStan/Rules/Arrays/NonexistentOffsetInArrayDimFetchRuleTest.php +++ b/tests/PHPStan/Rules/Arrays/NonexistentOffsetInArrayDimFetchRuleTest.php @@ -348,4 +348,9 @@ public function testRuleWithNullsafeVariant(): void ]); } + public function testBug4926(): void + { + $this->analyse([__DIR__ . '/data/bug-4926.php'], []); + } + } diff --git a/tests/PHPStan/Rules/Arrays/data/bug-4926.php b/tests/PHPStan/Rules/Arrays/data/bug-4926.php new file mode 100644 index 0000000000..6d5ecb9e8a --- /dev/null +++ b/tests/PHPStan/Rules/Arrays/data/bug-4926.php @@ -0,0 +1,17 @@ +data['customer']['first_name'] ?? null; + } +}