Skip to content

Commit 801fe6b

Browse files
committed
Added regression test
1 parent 1b56b0c commit 801fe6b

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

Diff for: tests/PHPStan/Rules/Arrays/NonexistentOffsetInArrayDimFetchRuleTest.php

+7
Original file line numberDiff line numberDiff line change
@@ -870,6 +870,13 @@ public function testBug8649(): void
870870
$this->analyse([__DIR__ . '/data/bug-8649.php'], []);
871871
}
872872

873+
public function testBug11447(): void
874+
{
875+
$this->reportPossiblyNonexistentGeneralArrayOffset = true;
876+
877+
$this->analyse([__DIR__ . '/data/bug-11447.php'], []);
878+
}
879+
873880
public function testNarrowSuperglobals(): void
874881
{
875882
$this->reportPossiblyNonexistentGeneralArrayOffset = true;

Diff for: tests/PHPStan/Rules/Arrays/data/bug-11447.php

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
namespace Bug11447;
4+
5+
function doFoo() {
6+
\assert( \array_key_exists( 'key1', $_GET ) && \is_numeric( $_GET['key1'] ) );
7+
\assert( isset( $_GET['key2'] ) && \is_numeric( $_GET['key2'] ) );
8+
}

0 commit comments

Comments
 (0)