-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
Promote some warnings in MBString Regex #5341
Conversation
c9a14a3
to
2ad2671
Compare
try { | ||
$var13 = mb_ereg_search_pos(); | ||
} catch (\Error $e) { | ||
echo $e->getMessage() . \PHP_EOL; | ||
} | ||
?> | ||
--EXPECTF-- | ||
Warning: mb_ereg_search_pos(): No regex given in %sbug72399.php on line %d | ||
--EXPECT-- | ||
bool(true) | ||
string(0) "" | ||
No pattern was provided |
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.
I really don't get why this throws, will need to investigate I suppose.
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.
Why shouldn't it throw?
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.
I don't know was confused, probably because I suppose it should throw before? As in in mb_ereg_search_init()
?
7903ef5
to
54b6ac2
Compare
54b6ac2
to
8092994
Compare
8092994
to
2aa6653
Compare
I think another PR also did something in this area, can you please rebase? |
2aa6653
to
5d36f8a
Compare
5d36f8a
to
fcd52e5
Compare
try { | ||
$var13 = mb_ereg_search_pos(); | ||
} catch (\Error $e) { | ||
echo $e->getMessage() . \PHP_EOL; | ||
} | ||
?> | ||
--EXPECTF-- | ||
Warning: mb_ereg_search_pos(): No regex given in %sbug72399.php on line %d | ||
--EXPECT-- | ||
bool(true) | ||
string(0) "" | ||
No pattern was provided |
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.
Why shouldn't it throw?
fcd52e5
to
fdac9bd
Compare
@@ -651,14 +651,16 @@ _php_mb_regex_init_options(const char *parg, size_t narg, OnigOptionType *option | |||
*syntax = ONIG_SYNTAX_POSIX_EXTENDED; | |||
break; | |||
case 'e': | |||
if (eval != NULL) *eval = 1; | |||
break; | |||
zend_value_error("Option \"e\" is not supported"); |
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.
You can remove this as a separate case (handle in default
). Or alternatively, use a different error message like "no longer supported".
I'm clueless on some of them if they should be converted or not.