diff options
| author | Dmitry Stogov <dmitry@zend.com> | 2014-07-11 16:32:20 +0400 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@zend.com> | 2014-07-11 16:32:20 +0400 |
| commit | 27f38798a1963de1c60aae4ef8a3675138255574 (patch) | |
| tree | 479abed5848c1b7c9eacec88c85d98c80acf07e7 /ext/standard/html.c | |
| parent | 8f229b285527a403d46be047546384032a0f6bb3 (diff) | |
| download | php-git-27f38798a1963de1c60aae4ef8a3675138255574.tar.gz | |
Fast parameter parsing API
This API is experemental. It may be changed or removed.
It should be used only for really often used functions.
(Keep the original parsing code and wrap usage with #ifndef FAST_ZPP)
Diffstat (limited to 'ext/standard/html.c')
| -rw-r--r-- | ext/standard/html.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ext/standard/html.c b/ext/standard/html.c index 7564fb8217..360639ea76 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -1448,9 +1448,19 @@ static void php_html_entities(INTERNAL_FUNCTION_PARAMETERS, int all) zend_string *replaced; zend_bool double_encode = 1; +#ifndef FAST_ZPP if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls!b", &str, &str_len, &flags, &hint_charset, &hint_charset_len, &double_encode) == FAILURE) { return; } +#else + ZEND_PARSE_PARAMETERS_START(1, 4) + Z_PARAM_STRING(str, str_len) + Z_PARAM_OPTIONAL + Z_PARAM_LONG(flags) + Z_PARAM_STRING_EX(hint_charset, hint_charset_len, 1, 0) + Z_PARAM_BOOL(double_encode); + ZEND_PARSE_PARAMETERS_END(); +#endif if (!hint_charset) { hint_charset = get_default_charset(TSRMLS_C); @@ -1521,10 +1531,19 @@ PHP_FUNCTION(html_entity_decode) long quote_style = ENT_COMPAT; zend_string *replaced; +#ifndef FAST_ZPP if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls", &str, &str_len, "e_style, &hint_charset, &hint_charset_len) == FAILURE) { return; } +#else + ZEND_PARSE_PARAMETERS_START(1, 3) + Z_PARAM_STRING(str, str_len) + Z_PARAM_OPTIONAL + Z_PARAM_LONG(quote_style) + Z_PARAM_STRING(hint_charset, hint_charset_len) + ZEND_PARSE_PARAMETERS_END(); +#endif if (!hint_charset) { hint_charset = get_default_charset(TSRMLS_C); |
