-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test for null behavior with ext/mbstring functions
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--TEST-- | ||
Optional long parameter might be null | ||
--FILE-- | ||
<?php | ||
echo mb_strpos('abb', 'b', null, 'UTF-8') . "\n"; | ||
echo mb_strrpos('abb', 'b', null, 'UTF-8') . "\n"; | ||
echo mb_stripos('abb', 'B', null, 'UTF-8') . "\n"; | ||
echo mb_strripos('abb', 'B', null, 'UTF-8') . "\n"; | ||
echo mb_strstr('foobarbaz', 'ba', null, 'UTF-8') . "\n"; | ||
echo mb_strrchr('foobarbaz', 'ba', null, 'UTF-8') . "\n"; | ||
echo mb_stristr('foobarbaz', 'BA', null, 'UTF-8') . "\n"; | ||
echo mb_strrichr('foobarbaz', 'BA', null, 'UTF-8') . "\n"; | ||
echo mb_substr('foobarbaz', 6, null, 'UTF-8') . "\n"; | ||
echo mb_strcut('foobarbaz', 6, null, 'UTF-8') . "\n"; | ||
echo mb_strimwidth('foobar', 0, 3, null, 'UTF-8') . "\n"; | ||
?> | ||
==DONE== | ||
--EXPECT-- | ||
1 | ||
2 | ||
1 | ||
2 | ||
barbaz | ||
baz | ||
barbaz | ||
baz | ||
baz | ||
baz | ||
foo | ||
==DONE== | ||
--XFAIL-- | ||
mb functions fail to allow null instead of actual value |