Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
clxmstaab committed May 16, 2022
1 parent a24da7e commit 995712c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/PHPStan/Analyser/data/non-empty-string-substr-specifying.php
Expand Up @@ -52,6 +52,16 @@ public function nonEmptySubstr(string $s, int $offset, int $length): void
}
assertType('string', $s);

if (substr($s, 10) == 'hallo') {
assertType('non-empty-string', $s);
}
assertType('string', $s);

if (substr($s, -10) == 'hallo') {
assertType('non-empty-string', $s);
}
assertType('string', $s);

$x = (substr($s, 10) === 'hallo');
assertType('string', $s);
var_dump($x);
Expand Down

0 comments on commit 995712c

Please sign in to comment.