Skip to content

Commit

Permalink
added rule test
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Jan 19, 2025
1 parent 3203a35 commit 89c7f69
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -924,4 +924,9 @@ public function testInternalClassesWithOverloadedOffsetAccessInvalid84(): void
$this->analyse([__DIR__ . '/data/internal-classes-overload-offset-access-invalid-php84.php'], []);
}

public function testBug12122(): void
{
$this->analyse([__DIR__ . '/data/bug-12122.php'], []);
}

}
8 changes: 8 additions & 0 deletions tests/PHPStan/Rules/Arrays/data/bug-12122.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Bug12122;

function doFoo() {
$foo = 'mystring';
var_dump($foo[-1]);
}

0 comments on commit 89c7f69

Please sign in to comment.