-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[RFC] Add a locale for grapheme case-insensitive functions #18792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--TEST-- | ||
grapheme_stripos() function locale dependency test | ||
--EXTENSIONS-- | ||
intl | ||
--FILE-- | ||
<?php | ||
var_dump(grapheme_stripos("abc", "abc", 0)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could you add more tests with invalid locales please ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure! Added. |
||
var_dump(grapheme_stripos("i", "\u{0130}", 0, "tr_TR")); | ||
var_dump(grapheme_stripos("i", "\u{0130}", 0, "en_US")); | ||
?> | ||
--EXPECT-- | ||
int(0) | ||
int(0) | ||
bool(false) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--TEST-- | ||
grapheme_stristr() function locale dependency test | ||
--EXTENSIONS-- | ||
intl | ||
--FILE-- | ||
<?php | ||
var_dump(grapheme_stristr("abc", "abc", 0)); | ||
var_dump(grapheme_stristr("i", "\u{0130}", 0, "tr_TR")); | ||
var_dump(grapheme_stristr("i", "\u{0130}", 0, "en_US")); | ||
?> | ||
--EXPECT-- | ||
string(3) "abc" | ||
string(1) "i" | ||
bool(false) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
little inconsistency here, maybe
locale_len = 0;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Added.