Skip to content

Commit c5a623b

Browse files
rgeraadsiluuu1994
authored andcommitted
Added negative offset test for mb_strrpos
Should expose #11217
1 parent aa553af commit c5a623b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ext/mbstring/tests/mb_strrpos_basic.phpt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ var_dump(mb_strrpos($string_ascii, 'is', 4, 'ISO-8859-1'));
2222
echo "\n-- ASCII string 2 --\n";
2323
var_dump(mb_strrpos($string_ascii, 'hello, world'));
2424

25+
echo "\n-- ASCII string with negative offset --\n";
26+
var_dump(mb_strrpos($string_ascii, 'hello', -1, 'ISO-8859-1'));
27+
2528
echo "\n-- Multibyte string 1 --\n";
2629
$needle1 = base64_decode('44CC');
2730
var_dump(mb_strrpos($string_mb, $needle1));
@@ -41,6 +44,9 @@ int(15)
4144
-- ASCII string 2 --
4245
bool(false)
4346

47+
-- ASCII string with negative offset --
48+
bool(false)
49+
4450
-- Multibyte string 1 --
4551
int(20)
4652

0 commit comments

Comments
 (0)