From 3c9f02032dd973b624c1fc0efb55497b55c0461f Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Mon, 28 Jul 2025 08:38:53 +0200 Subject: [PATCH] Add non regression test --- ...nexistentOffsetInArrayDimFetchRuleTest.php | 5 ++++ tests/PHPStan/Rules/Arrays/data/bug-4809.php | 27 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 tests/PHPStan/Rules/Arrays/data/bug-4809.php diff --git a/tests/PHPStan/Rules/Arrays/NonexistentOffsetInArrayDimFetchRuleTest.php b/tests/PHPStan/Rules/Arrays/NonexistentOffsetInArrayDimFetchRuleTest.php index a481085088..9db16af6c9 100644 --- a/tests/PHPStan/Rules/Arrays/NonexistentOffsetInArrayDimFetchRuleTest.php +++ b/tests/PHPStan/Rules/Arrays/NonexistentOffsetInArrayDimFetchRuleTest.php @@ -907,6 +907,11 @@ public function testBug12605(): void ]); } + public function testBug4809(): void + { + $this->analyse([__DIR__ . '/data/bug-4809.php'], []); + } + public function testBug11602(): void { $this->reportPossiblyNonexistentGeneralArrayOffset = true; diff --git a/tests/PHPStan/Rules/Arrays/data/bug-4809.php b/tests/PHPStan/Rules/Arrays/data/bug-4809.php new file mode 100644 index 0000000000..92f626854e --- /dev/null +++ b/tests/PHPStan/Rules/Arrays/data/bug-4809.php @@ -0,0 +1,27 @@ +