Skip to content

Commit f5c2054

Browse files
committed
added rule test
1 parent d9a8d9a commit f5c2054

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

tests/PHPStan/Rules/Arrays/NonexistentOffsetInArrayDimFetchRuleTest.php

+5
Original file line numberDiff line numberDiff line change
@@ -924,4 +924,9 @@ public function testInternalClassesWithOverloadedOffsetAccessInvalid84(): void
924924
$this->analyse([__DIR__ . '/data/internal-classes-overload-offset-access-invalid-php84.php'], []);
925925
}
926926

927+
public function testBug12122(): void
928+
{
929+
$this->analyse([__DIR__ . '/data/bug-12122.php'], []);
930+
}
931+
927932
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
namespace Bug12122;
4+
5+
function doFoo() {
6+
$foo = 'mystring';
7+
var_dump($foo[-1]);
8+
}

0 commit comments

Comments
 (0)