Skip to content

Commit 392e58d

Browse files
committed
Regression test for a crash related to str_increment
1 parent 5f68a09 commit 392e58d

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace bug13481;
4+
5+
use function PHPStan\Testing\assertType;
6+
use function str_increment;
7+
8+
function bug13481() {
9+
$s = 'ab c1';
10+
assertType("*NEVER*", str_increment($s));
11+
12+
++$s;
13+
assertType("*NEVER*", $s);
14+
}
15+
16+
function bug13481b() {
17+
$s = '%';
18+
assertType("*NEVER*", str_increment($s));
19+
20+
++$s;
21+
assertType("*NEVER*", $s);
22+
}
23+

0 commit comments

Comments
 (0)