diff options
Diffstat (limited to 'ext/standard/string.c')
-rw-r--r-- | ext/standard/string.c | 102 |
1 files changed, 0 insertions, 102 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c index a3b0add7f0..5e6b207265 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -898,17 +898,11 @@ static void php_do_trim(INTERNAL_FUNCTION_PARAMETERS, int mode) zend_string *str; zend_string *what = NULL; -#ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|S", &str, &what) == FAILURE) { - return; - } -#else ZEND_PARSE_PARAMETERS_START(1, 2) Z_PARAM_STR(str) Z_PARAM_OPTIONAL Z_PARAM_STR(what) ZEND_PARSE_PARAMETERS_END(); -#endif ZVAL_STR(return_value, php_trim(str, (what ? ZSTR_VAL(what) : NULL), (what ? ZSTR_LEN(what) : 0), mode)); } @@ -1156,18 +1150,12 @@ PHP_FUNCTION(explode) zend_long limit = ZEND_LONG_MAX; /* No limit */ zval tmp; -#ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|l", &delim, &str, &limit) == FAILURE) { - return; - } -#else ZEND_PARSE_PARAMETERS_START(2, 3) Z_PARAM_STR(delim) Z_PARAM_STR(str) Z_PARAM_OPTIONAL Z_PARAM_LONG(limit) ZEND_PARSE_PARAMETERS_END(); -#endif if (ZSTR_LEN(delim) == 0) { php_error_docref(NULL, E_WARNING, "Empty delimiter"); @@ -1286,17 +1274,11 @@ PHP_FUNCTION(implode) zval *arg1, *arg2 = NULL, *arr; zend_string *delim; -#ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|z", &arg1, &arg2) == FAILURE) { - return; - } -#else ZEND_PARSE_PARAMETERS_START(1, 2) Z_PARAM_ZVAL(arg1) Z_PARAM_OPTIONAL Z_PARAM_ZVAL(arg2) ZEND_PARSE_PARAMETERS_END(); -#endif if (arg2 == NULL) { if (Z_TYPE_P(arg1) != IS_ARRAY) { @@ -1337,17 +1319,11 @@ PHP_FUNCTION(strtok) char *pe; size_t skipped = 0; -#ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|S", &str, &tok) == FAILURE) { - return; - } -#else ZEND_PARSE_PARAMETERS_START(1, 2) Z_PARAM_STR(str) Z_PARAM_OPTIONAL Z_PARAM_STR(tok) ZEND_PARSE_PARAMETERS_END(); -#endif if (ZEND_NUM_ARGS() == 1) { tok = str; @@ -1464,15 +1440,9 @@ PHP_FUNCTION(strtoupper) { zend_string *arg; -#ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &arg) == FAILURE) { - return; - } -#else ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_STR(arg) ZEND_PARSE_PARAMETERS_END(); -#endif RETURN_STR(php_string_toupper(arg)); } @@ -1533,15 +1503,9 @@ PHP_FUNCTION(strtolower) { zend_string *str; -#ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) { - return; - } -#else ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_STR(str) ZEND_PARSE_PARAMETERS_END(); -#endif RETURN_STR(php_string_tolower(str)); } @@ -1960,18 +1924,12 @@ PHP_FUNCTION(strpos) char needle_char[2]; zend_long offset = 0; -#ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|l", &haystack, &needle, &offset) == FAILURE) { - return; - } -#else ZEND_PARSE_PARAMETERS_START(2, 3) Z_PARAM_STR(haystack) Z_PARAM_ZVAL(needle) Z_PARAM_OPTIONAL Z_PARAM_LONG(offset) ZEND_PARSE_PARAMETERS_END(); -#endif if (offset < 0) { offset += (zend_long)ZSTR_LEN(haystack); @@ -2086,18 +2044,12 @@ PHP_FUNCTION(strrpos) char *p, *e, ord_needle[2]; char *found; -#ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|l", &haystack, &zneedle, &offset) == FAILURE) { - RETURN_FALSE; - } -#else ZEND_PARSE_PARAMETERS_START(2, 3) Z_PARAM_STR(haystack) Z_PARAM_ZVAL(zneedle) Z_PARAM_OPTIONAL Z_PARAM_LONG(offset) ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE); -#endif if (Z_TYPE_P(zneedle) == IS_STRING) { needle = Z_STRVAL_P(zneedle); @@ -2384,18 +2336,12 @@ PHP_FUNCTION(substr) zend_long l = 0, f; int argc = ZEND_NUM_ARGS(); -#ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sl|l", &str, &f, &l) == FAILURE) { - return; - } -#else ZEND_PARSE_PARAMETERS_START(2, 3) Z_PARAM_STR(str) Z_PARAM_LONG(f) Z_PARAM_OPTIONAL Z_PARAM_LONG(l) ZEND_PARSE_PARAMETERS_END(); -#endif if (argc > 2) { if ((l < 0 && (size_t)(-l) > ZSTR_LEN(str))) { @@ -2759,15 +2705,9 @@ PHP_FUNCTION(ord) char *str; size_t str_len; -#ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) { - return; - } -#else ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_STRING(str, str_len) ZEND_PARSE_PARAMETERS_END(); -#endif RETURN_LONG((unsigned char) str[0]); } @@ -2784,15 +2724,9 @@ PHP_FUNCTION(chr) WRONG_PARAM_COUNT; } -#ifndef FAST_ZPP - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "l", &c) == FAILURE) { - c = 0; - } -#else ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_QUIET, 1, 1) Z_PARAM_LONG(c) ZEND_PARSE_PARAMETERS_END_EX(c = 0); -#endif c &= 0xff; if (CG(one_char_string)[c]) { @@ -2821,15 +2755,9 @@ PHP_FUNCTION(ucfirst) { zend_string *str; -#ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) { - return; - } -#else ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_STR(str) ZEND_PARSE_PARAMETERS_END(); -#endif if (!ZSTR_LEN(str)) { RETURN_EMPTY_STRING(); @@ -2879,17 +2807,11 @@ PHP_FUNCTION(ucwords) size_t delims_len = 6; char mask[256]; -#ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|s", &str, &delims, &delims_len) == FAILURE) { - return; - } -#else ZEND_PARSE_PARAMETERS_START(1, 2) Z_PARAM_STR(str) Z_PARAM_OPTIONAL Z_PARAM_STRING(delims, delims_len) ZEND_PARSE_PARAMETERS_END(); -#endif if (!ZSTR_LEN(str)) { RETURN_EMPTY_STRING(); @@ -3457,18 +3379,12 @@ PHP_FUNCTION(strtr) size_t to_len = 0; int ac = ZEND_NUM_ARGS(); -#ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|s", &str, &from, &to, &to_len) == FAILURE) { - return; - } -#else ZEND_PARSE_PARAMETERS_START(2, 3) Z_PARAM_STR(str) Z_PARAM_ZVAL(from) Z_PARAM_OPTIONAL Z_PARAM_STRING(to, to_len) ZEND_PARSE_PARAMETERS_END(); -#endif if (ac == 2 && Z_TYPE_P(from) != IS_ARRAY) { php_error_docref(NULL, E_WARNING, "The second argument is not an array"); @@ -3704,15 +3620,9 @@ PHP_FUNCTION(addslashes) { zend_string *str; -#ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) { - return; - } -#else ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_STR(str) ZEND_PARSE_PARAMETERS_END(); -#endif if (ZSTR_LEN(str) == 0) { RETURN_EMPTY_STRING(); @@ -4130,11 +4040,6 @@ static void php_str_replace_common(INTERNAL_FUNCTION_PARAMETERS, int case_sensit zend_long count = 0; int argc = ZEND_NUM_ARGS(); -#ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS(), "zzz|z/", &search, &replace, &subject, &zcount) == FAILURE) { - return; - } -#else ZEND_PARSE_PARAMETERS_START(3, 4) Z_PARAM_ZVAL(search) Z_PARAM_ZVAL(replace) @@ -4142,7 +4047,6 @@ static void php_str_replace_common(INTERNAL_FUNCTION_PARAMETERS, int case_sensit Z_PARAM_OPTIONAL Z_PARAM_ZVAL_EX(zcount, 0, 1) ZEND_PARSE_PARAMETERS_END(); -#endif /* Make sure we're dealing with strings and do the replacement. */ if (Z_TYPE_P(search) != IS_ARRAY) { @@ -4400,17 +4304,11 @@ PHP_FUNCTION(nl2br) zend_bool is_xhtml = 1; zend_string *result; -#ifndef FAST_ZPP - if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &str, &is_xhtml) == FAILURE) { - return; - } -#else ZEND_PARSE_PARAMETERS_START(1, 2) Z_PARAM_STR(str) Z_PARAM_OPTIONAL Z_PARAM_BOOL(is_xhtml) ZEND_PARSE_PARAMETERS_END(); -#endif tmp = ZSTR_VAL(str); end = ZSTR_VAL(str) + ZSTR_LEN(str); |