Browse Source

Use FAST_ZPP in few more frequently used functions

pull/996/head
Dmitry Stogov 12 years ago
parent
commit
c5047d1f11
  1. 7
      Zend/zend_builtin_functions.c
  2. 6
      ext/standard/array.c
  3. 6
      ext/standard/string.c
  4. 13
      ext/standard/type.c

7
Zend/zend_builtin_functions.c

@ -670,9 +670,16 @@ ZEND_FUNCTION(error_reporting)
zend_string *err;
int old_error_reporting;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|S", &err) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
Z_PARAM_STR(err)
ZEND_PARSE_PARAMETERS_END();
#endif
old_error_reporting = EG(error_reporting);
if(ZEND_NUM_ARGS() != 0) {

6
ext/standard/array.c

@ -2788,9 +2788,15 @@ PHP_FUNCTION(array_values)
zval *input, /* Input array */
*entry; /* An entry in the input array */
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "a", &input) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_ARRAY(input)
ZEND_PARSE_PARAMETERS_END();
#endif
/* Initialize return array */
array_init_size(return_value, zend_hash_num_elements(Z_ARRVAL_P(input)));

6
ext/standard/string.c

@ -1406,9 +1406,15 @@ 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));
}

13
ext/standard/type.c

@ -194,9 +194,16 @@ PHP_FUNCTION(boolval)
PHP_FUNCTION(strval)
{
zval *num;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &num) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_ZVAL(num)
ZEND_PARSE_PARAMETERS_END();
#endif
RETVAL_STR(zval_get_string(num));
}
@ -322,9 +329,15 @@ PHP_FUNCTION(is_numeric)
{
zval *arg;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_ZVAL(arg)
ZEND_PARSE_PARAMETERS_END();
#endif
switch (Z_TYPE_P(arg)) {
case IS_LONG:

Loading…
Cancel
Save