summaryrefslogtreecommitdiff
path: root/ext/mbstring
diff options
context:
space:
mode:
authorGeorge Peter Banyard <girgias@php.net>2020-04-02 18:43:57 +0200
committerGeorge Peter Banyard <girgias@php.net>2020-04-02 22:40:00 +0200
commit577de174dedd41c5825a140a263fd7078d383184 (patch)
tree8b0bbc25aba9e8504819fc79240d17c7a35cab53 /ext/mbstring
parent4cd3d7b166d9075d82e4dd761bea6b840af1618c (diff)
downloadphp-git-577de174dedd41c5825a140a263fd7078d383184.tar.gz
Use ZEND_NUM_ARGS() macro instead of custom variable
Also why on earth would someone do this?
Diffstat (limited to 'ext/mbstring')
-rw-r--r--ext/mbstring/php_mbregex.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c
index c4e066fccc..a701021c13 100644
--- a/ext/mbstring/php_mbregex.c
+++ b/ext/mbstring/php_mbregex.c
@@ -1533,18 +1533,17 @@ PHP_FUNCTION(mb_ereg_search_regs)
Initialize string and regular expression for search. */
PHP_FUNCTION(mb_ereg_search_init)
{
- int argc = ZEND_NUM_ARGS();
zend_string *arg_str;
char *arg_pattern = NULL, *arg_options = NULL;
size_t arg_pattern_len = 0, arg_options_len = 0;
OnigSyntaxType *syntax = NULL;
OnigOptionType option;
- if (zend_parse_parameters(argc, "S|ss", &arg_str, &arg_pattern, &arg_pattern_len, &arg_options, &arg_options_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|ss", &arg_str, &arg_pattern, &arg_pattern_len, &arg_options, &arg_options_len) == FAILURE) {
RETURN_THROWS();
}
- if (argc > 1 && arg_pattern_len == 0) {
+ if (ZEND_NUM_ARGS() > 1 && arg_pattern_len == 0) {
php_error_docref(NULL, E_WARNING, "Empty pattern");
RETURN_FALSE;
}
@@ -1552,12 +1551,12 @@ PHP_FUNCTION(mb_ereg_search_init)
option = MBREX(regex_default_options);
syntax = MBREX(regex_default_syntax);
- if (argc == 3) {
+ if (ZEND_NUM_ARGS() == 3) {
option = 0;
_php_mb_regex_init_options(arg_options, arg_options_len, &option, &syntax, NULL);
}
- if (argc > 1) {
+ if (ZEND_NUM_ARGS() > 1) {
/* create regex pattern buffer */
if ((MBREX(search_re) = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, option, syntax)) == NULL) {
RETURN_FALSE;