]> granicus.if.org Git - php/commitdiff
Use FAST_ZPP in few more frequently used functions
authorDmitry Stogov <dmitry@zend.com>
Mon, 12 Jan 2015 16:26:12 +0000 (19:26 +0300)
committerDmitry Stogov <dmitry@zend.com>
Mon, 12 Jan 2015 16:26:12 +0000 (19:26 +0300)
Zend/zend_builtin_functions.c
ext/standard/array.c
ext/standard/string.c
ext/standard/type.c

index 9e3f5296fa493a7e1d5adfc6b83f7ef2bf55f799..6588c2ded19762ba089a1582550da9480eb5eee5 100644 (file)
@@ -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) {
index a85aa8b19e70064954916bb16a650a67a6ca00c9..f31015b1e2bbbe7ce1dc6a3c3eef7d2d93c89f21 100644 (file)
@@ -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)));
index 135008f63c52025800c0770ee20781cb96abcfb2..c377caef1e291898f569d39e83cd031a42eac144 100644 (file)
@@ -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));
 }
index a260c436cb89d056d4fe3590dc79405e29562865..d70672ea770051e0c5e07e19f0e7194915e80d7a 100644 (file)
@@ -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: