mirror of
https://github.com/php/php-src.git
synced 2026-03-26 01:02:25 +01:00
Merge branch 'PHP-7.1'
This commit is contained in:
@@ -202,7 +202,6 @@ ZEND_API char *zend_zval_type_name(const zval *arg) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
#ifdef FAST_ZPP
|
||||
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_count_error(int num_args, int min_num_args, int max_num_args) /* {{{ */
|
||||
{
|
||||
zend_function *active_function = EG(current_execute_data)->func;
|
||||
@@ -298,7 +297,6 @@ ZEND_API int ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **pc
|
||||
return 1;
|
||||
}
|
||||
/* }}} */
|
||||
#endif
|
||||
|
||||
ZEND_API int ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, zend_bool *dest) /* {{{ */
|
||||
{
|
||||
|
||||
@@ -676,13 +676,11 @@ END_EXTERN_C()
|
||||
|
||||
/* Fast parameter parsing API */
|
||||
|
||||
/* This API should be used only for really often used functions.
|
||||
* (Keep the original parsing code and wrap usage with #ifndef FAST_ZPP)
|
||||
/* Fast ZPP is always enabled now; this define is left in for compatibility
|
||||
* with any existing conditional compilation blocks.
|
||||
*/
|
||||
#define FAST_ZPP 1
|
||||
|
||||
#ifdef FAST_ZPP
|
||||
|
||||
#define Z_EXPECTED_TYPES(_) \
|
||||
_(Z_EXPECTED_LONG, "integer") \
|
||||
_(Z_EXPECTED_BOOL, "boolean") \
|
||||
@@ -1045,8 +1043,6 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(int severity, in
|
||||
#define Z_PARAM_VARIADIC(spec, dest, dest_num) \
|
||||
Z_PARAM_VARIADIC_EX(spec, dest, dest_num, 0)
|
||||
|
||||
#endif /* FAST_ZPP */
|
||||
|
||||
/* End of new parameter parsing API */
|
||||
|
||||
/* Inlined implementations shared by new and old parameter parsing APIs */
|
||||
|
||||
@@ -622,15 +622,9 @@ ZEND_FUNCTION(strlen)
|
||||
{
|
||||
zend_string *s;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &s) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_STR(s)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
RETVAL_LONG(ZSTR_LEN(s));
|
||||
}
|
||||
@@ -770,16 +764,10 @@ ZEND_FUNCTION(error_reporting)
|
||||
zval *err = NULL;
|
||||
int old_error_reporting;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z", &err) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(0, 1)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_ZVAL(err)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
old_error_reporting = EG(error_reporting);
|
||||
if (ZEND_NUM_ARGS() != 0) {
|
||||
@@ -893,18 +881,12 @@ ZEND_FUNCTION(define)
|
||||
int case_sensitive = CONST_CS;
|
||||
zend_constant c;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|b", &name, &val, &non_cs) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 3)
|
||||
Z_PARAM_STR(name)
|
||||
Z_PARAM_ZVAL(val)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_BOOL(non_cs)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (non_cs) {
|
||||
case_sensitive = 0;
|
||||
@@ -985,15 +967,9 @@ ZEND_FUNCTION(defined)
|
||||
{
|
||||
zend_string *name;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_STR(name)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (zend_get_constant_ex(name, zend_get_executed_scope(), ZEND_FETCH_CLASS_SILENT)) {
|
||||
RETURN_TRUE;
|
||||
@@ -1094,18 +1070,12 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass) /*
|
||||
zend_bool allow_string = only_subclass;
|
||||
zend_bool retval;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zS|b", &obj, &class_name, &allow_string) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 3)
|
||||
Z_PARAM_ZVAL(obj)
|
||||
Z_PARAM_STR(class_name)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_BOOL(allow_string)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
/*
|
||||
* allow_string - is_a default is no, is_subclass_of is yes.
|
||||
* if it's allowed, then the autoloader will be called if the class does not exist.
|
||||
@@ -1246,15 +1216,9 @@ ZEND_FUNCTION(get_object_vars)
|
||||
zend_string *key;
|
||||
zend_object *zobj;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_OBJECT(obj)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (Z_OBJ_HT_P(obj)->get_properties == NULL) {
|
||||
RETURN_FALSE;
|
||||
@@ -1392,16 +1356,11 @@ ZEND_FUNCTION(method_exists)
|
||||
zend_string *lcname;
|
||||
zend_class_entry * ce;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zS", &klass, &method_name) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 2)
|
||||
Z_PARAM_ZVAL(klass)
|
||||
Z_PARAM_STR(method_name)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (Z_TYPE_P(klass) == IS_OBJECT) {
|
||||
ce = Z_OBJCE_P(klass);
|
||||
} else if (Z_TYPE_P(klass) == IS_STRING) {
|
||||
@@ -1497,17 +1456,11 @@ ZEND_FUNCTION(class_exists)
|
||||
zend_class_entry *ce;
|
||||
zend_bool autoload = 1;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &class_name, &autoload) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 2)
|
||||
Z_PARAM_STR(class_name)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_BOOL(autoload)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (!autoload) {
|
||||
if (ZSTR_VAL(class_name)[0] == '\\') {
|
||||
@@ -1540,17 +1493,11 @@ ZEND_FUNCTION(interface_exists)
|
||||
zend_class_entry *ce;
|
||||
zend_bool autoload = 1;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &iface_name, &autoload) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 2)
|
||||
Z_PARAM_STR(iface_name)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_BOOL(autoload)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (!autoload) {
|
||||
if (ZSTR_VAL(iface_name)[0] == '\\') {
|
||||
@@ -1582,17 +1529,11 @@ ZEND_FUNCTION(trait_exists)
|
||||
zend_class_entry *ce;
|
||||
zend_bool autoload = 1;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &trait_name, &autoload) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 2)
|
||||
Z_PARAM_STR(trait_name)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_BOOL(autoload)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (!autoload) {
|
||||
if (ZSTR_VAL(trait_name)[0] == '\\') {
|
||||
@@ -1625,15 +1566,9 @@ ZEND_FUNCTION(function_exists)
|
||||
zend_function *func;
|
||||
zend_string *lcname;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_STR(name)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (ZSTR_VAL(name)[0] == '\\') {
|
||||
/* Ignore leading "\" */
|
||||
|
||||
@@ -980,15 +980,9 @@ ZEND_METHOD(Generator, send)
|
||||
zval *value;
|
||||
zend_generator *generator, *root;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_ZVAL(value)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
generator = (zend_generator *) Z_OBJ_P(getThis());
|
||||
|
||||
@@ -1024,15 +1018,9 @@ ZEND_METHOD(Generator, throw)
|
||||
zval *exception, exception_copy;
|
||||
zend_generator *generator;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &exception) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_ZVAL(exception)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
ZVAL_DUP(&exception_copy, exception);
|
||||
|
||||
|
||||
@@ -189,15 +189,9 @@ PHP_NAMED_FUNCTION(zif_gettext)
|
||||
char *msgstr;
|
||||
zend_string *msgid;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &msgid) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_STR(msgid)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
PHP_GETTEXT_LENGTH_CHECK("msgid", ZSTR_LEN(msgid))
|
||||
msgstr = gettext(ZSTR_VAL(msgid));
|
||||
|
||||
@@ -631,12 +631,6 @@ static void php_do_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global) /* {{{ *
|
||||
zend_long flags = 0; /* Match control flags */
|
||||
zend_long start_offset = 0; /* Where the new search starts */
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|z/ll", ®ex,
|
||||
&subject, &subpats, &flags, &start_offset) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 5)
|
||||
Z_PARAM_STR(regex)
|
||||
Z_PARAM_STR(subject)
|
||||
@@ -645,7 +639,6 @@ static void php_do_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global) /* {{{ *
|
||||
Z_PARAM_LONG(flags)
|
||||
Z_PARAM_LONG(start_offset)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
||||
#endif
|
||||
|
||||
if (ZEND_SIZE_T_INT_OVFL(ZSTR_LEN(subject))) {
|
||||
php_error_docref(NULL, E_WARNING, "Subject is too long");
|
||||
@@ -1542,12 +1535,7 @@ static PHP_FUNCTION(preg_replace)
|
||||
zend_long limit = -1;
|
||||
int replace_count;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
/* Get function parameters and do error-checking. */
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zzz|lz/", ®ex, &replace, &subject, &limit, &zcount) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(3, 5)
|
||||
Z_PARAM_ZVAL(regex)
|
||||
Z_PARAM_ZVAL(replace)
|
||||
@@ -1556,7 +1544,6 @@ static PHP_FUNCTION(preg_replace)
|
||||
Z_PARAM_LONG(limit)
|
||||
Z_PARAM_ZVAL_EX(zcount, 0, 1)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (Z_TYPE_P(replace) == IS_ARRAY && Z_TYPE_P(regex) != IS_ARRAY) {
|
||||
php_error_docref(NULL, E_WARNING, "Parameter mismatch, pattern is a string while replacement is an array");
|
||||
@@ -1580,12 +1567,7 @@ static PHP_FUNCTION(preg_replace_callback)
|
||||
zend_string *callback_name;
|
||||
int replace_count;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
/* Get function parameters and do error-checking. */
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zzz|lz/", ®ex, &replace, &subject, &limit, &zcount) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(3, 5)
|
||||
Z_PARAM_ZVAL(regex)
|
||||
Z_PARAM_ZVAL(replace)
|
||||
@@ -1594,7 +1576,6 @@ static PHP_FUNCTION(preg_replace_callback)
|
||||
Z_PARAM_LONG(limit)
|
||||
Z_PARAM_ZVAL_EX(zcount, 0, 1)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (!zend_is_callable(replace, 0, &callback_name)) {
|
||||
php_error_docref(NULL, E_WARNING, "Requires argument 2, '%s', to be a valid callback", ZSTR_VAL(callback_name));
|
||||
@@ -1622,12 +1603,7 @@ static PHP_FUNCTION(preg_replace_callback_array)
|
||||
zend_string *callback_name;
|
||||
int replace_count = 0;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
/* Get function parameters and do error-checking. */
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "az|lz/", &pattern, &subject, &limit, &zcount) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 4)
|
||||
Z_PARAM_ARRAY(pattern)
|
||||
Z_PARAM_ZVAL(subject)
|
||||
@@ -1635,7 +1611,6 @@ static PHP_FUNCTION(preg_replace_callback_array)
|
||||
Z_PARAM_LONG(limit)
|
||||
Z_PARAM_ZVAL_EX(zcount, 0, 1)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
ZVAL_UNDEF(&zv);
|
||||
ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARRVAL_P(pattern), str_idx, replace) {
|
||||
@@ -1693,12 +1668,7 @@ static PHP_FUNCTION(preg_filter)
|
||||
zend_long limit = -1;
|
||||
int replace_count;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
/* Get function parameters and do error-checking. */
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zzz|lz/", ®ex, &replace, &subject, &limit, &zcount) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(3, 5)
|
||||
Z_PARAM_ZVAL(regex)
|
||||
Z_PARAM_ZVAL(replace)
|
||||
@@ -1707,7 +1677,6 @@ static PHP_FUNCTION(preg_filter)
|
||||
Z_PARAM_LONG(limit)
|
||||
Z_PARAM_ZVAL_EX(zcount, 0, 1)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (Z_TYPE_P(replace) == IS_ARRAY && Z_TYPE_P(regex) != IS_ARRAY) {
|
||||
php_error_docref(NULL, E_WARNING, "Parameter mismatch, pattern is a string while replacement is an array");
|
||||
@@ -1733,12 +1702,6 @@ static PHP_FUNCTION(preg_split)
|
||||
pcre_cache_entry *pce; /* Compiled regular expression */
|
||||
|
||||
/* Get function parameters and do error checking */
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|ll", ®ex,
|
||||
&subject, &limit_val, &flags) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 4)
|
||||
Z_PARAM_STR(regex)
|
||||
Z_PARAM_STR(subject)
|
||||
@@ -1746,7 +1709,6 @@ static PHP_FUNCTION(preg_split)
|
||||
Z_PARAM_LONG(limit_val)
|
||||
Z_PARAM_LONG(flags)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
||||
#endif
|
||||
|
||||
if (ZEND_SIZE_T_INT_OVFL(ZSTR_LEN(subject))) {
|
||||
php_error_docref(NULL, E_WARNING, "Subject is too long");
|
||||
@@ -1939,18 +1901,11 @@ static PHP_FUNCTION(preg_quote)
|
||||
zend_bool quote_delim = 0; /* Whether to quote additional delim char */
|
||||
|
||||
/* Get the arguments and check for errors */
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", &in_str, &in_str_len,
|
||||
&delim, &delim_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 2)
|
||||
Z_PARAM_STRING(in_str, in_str_len)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_STRING(delim, delim_len)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
in_str_end = in_str + in_str_len;
|
||||
|
||||
@@ -2028,19 +1983,12 @@ static PHP_FUNCTION(preg_grep)
|
||||
pcre_cache_entry *pce; /* Compiled regular expression */
|
||||
|
||||
/* Get arguments and do error checking */
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sa|l", ®ex,
|
||||
&input, &flags) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 3)
|
||||
Z_PARAM_STR(regex)
|
||||
Z_PARAM_ARRAY(input)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_LONG(flags)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
/* Compile regex or get it from cache. */
|
||||
if ((pce = pcre_get_compiled_regex_cache(regex)) == NULL) {
|
||||
@@ -2141,14 +2089,8 @@ PHPAPI void php_pcre_grep_impl(pcre_cache_entry *pce, zval *input, zval *return
|
||||
Returns the error code of the last regexp execution. */
|
||||
static PHP_FUNCTION(preg_last_error)
|
||||
{
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(0, 0)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
RETURN_LONG(PCRE_G(error_code));
|
||||
}
|
||||
|
||||
@@ -1555,17 +1555,11 @@ ZEND_METHOD(reflection, export)
|
||||
int result;
|
||||
zend_bool return_output = 0;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|b", &object, reflector_ptr, &return_output) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 2)
|
||||
Z_PARAM_OBJECT_OF_CLASS(object, reflector_ptr)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_BOOL(return_output)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
/* Invoke the __toString() method */
|
||||
ZVAL_STRINGL(&fname, "__tostring", sizeof("__tostring") - 1);
|
||||
|
||||
@@ -1225,15 +1225,9 @@ SPL_METHOD(Array, setIteratorClass)
|
||||
spl_array_object *intern = Z_SPLARRAY_P(object);
|
||||
zend_class_entry * ce_get_iterator = spl_ce_Iterator;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "C", &ce_get_iterator) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_CLASS(ce_get_iterator)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
intern->ce_get_iterator = ce_get_iterator;
|
||||
}
|
||||
|
||||
@@ -705,17 +705,11 @@ PHP_FUNCTION(krsort)
|
||||
zend_long sort_type = PHP_SORT_REGULAR;
|
||||
compare_func_t cmp;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/|l", &array, &sort_type) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 2)
|
||||
Z_PARAM_ARRAY_EX(array, 0, 1)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_LONG(sort_type)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
||||
#endif
|
||||
|
||||
cmp = php_get_key_compare_func(sort_type, 1);
|
||||
|
||||
@@ -734,17 +728,11 @@ PHP_FUNCTION(ksort)
|
||||
zend_long sort_type = PHP_SORT_REGULAR;
|
||||
compare_func_t cmp;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/|l", &array, &sort_type) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 2)
|
||||
Z_PARAM_ARRAY_EX(array, 0, 1)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_LONG(sort_type)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
||||
#endif
|
||||
|
||||
cmp = php_get_key_compare_func(sort_type, 0);
|
||||
|
||||
@@ -794,17 +782,11 @@ PHP_FUNCTION(count)
|
||||
zend_long cnt;
|
||||
zval *element;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|l", &array, &mode) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 2)
|
||||
Z_PARAM_ZVAL(array)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_LONG(mode)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
switch (Z_TYPE_P(array)) {
|
||||
case IS_NULL:
|
||||
@@ -1135,15 +1117,9 @@ PHP_FUNCTION(end)
|
||||
HashTable *array;
|
||||
zval *entry;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/", &array) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_ARRAY_OR_OBJECT_HT_EX(array, 0, 1)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
zend_hash_internal_pointer_end(array);
|
||||
|
||||
@@ -1169,15 +1145,9 @@ PHP_FUNCTION(prev)
|
||||
HashTable *array;
|
||||
zval *entry;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/", &array) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_ARRAY_OR_OBJECT_HT_EX(array, 0, 1)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
zend_hash_move_backwards(array);
|
||||
|
||||
@@ -1203,15 +1173,9 @@ PHP_FUNCTION(next)
|
||||
HashTable *array;
|
||||
zval *entry;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/", &array) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_ARRAY_OR_OBJECT_HT_EX(array, 0, 1)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
zend_hash_move_forward(array);
|
||||
|
||||
@@ -1237,15 +1201,9 @@ PHP_FUNCTION(reset)
|
||||
HashTable *array;
|
||||
zval *entry;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "H/", &array) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_ARRAY_OR_OBJECT_HT_EX(array, 0, 1)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
zend_hash_internal_pointer_reset(array);
|
||||
|
||||
@@ -1271,15 +1229,9 @@ PHP_FUNCTION(current)
|
||||
HashTable *array;
|
||||
zval *entry;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "H", &array) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_ARRAY_OR_OBJECT_HT(array)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if ((entry = zend_hash_get_current_data(array)) == NULL) {
|
||||
RETURN_FALSE;
|
||||
@@ -1300,15 +1252,9 @@ PHP_FUNCTION(key)
|
||||
{
|
||||
HashTable *array;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "H", &array) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_ARRAY_OR_OBJECT_HT(array)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
zend_hash_get_current_key_zval(array, return_value);
|
||||
}
|
||||
@@ -1550,13 +1496,6 @@ PHP_FUNCTION(array_walk)
|
||||
orig_array_walk_fci = BG(array_walk_fci);
|
||||
orig_array_walk_fci_cache = BG(array_walk_fci_cache);
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "A/f|z/", &array, &BG(array_walk_fci), &BG(array_walk_fci_cache), &userdata) == FAILURE) {
|
||||
BG(array_walk_fci) = orig_array_walk_fci;
|
||||
BG(array_walk_fci_cache) = orig_array_walk_fci_cache;
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 3)
|
||||
Z_PARAM_ARRAY_OR_OBJECT_EX(array, 0, 1)
|
||||
Z_PARAM_FUNC(BG(array_walk_fci), BG(array_walk_fci_cache))
|
||||
@@ -1567,7 +1506,6 @@ PHP_FUNCTION(array_walk)
|
||||
BG(array_walk_fci_cache) = orig_array_walk_fci_cache;
|
||||
return
|
||||
);
|
||||
#endif
|
||||
|
||||
php_array_walk(array, userdata, 0);
|
||||
BG(array_walk_fci) = orig_array_walk_fci;
|
||||
@@ -1614,18 +1552,12 @@ static inline void php_search_array(INTERNAL_FUNCTION_PARAMETERS, int behavior)
|
||||
zend_string *str_idx;
|
||||
zend_bool strict = 0; /* strict comparison or not */
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "za|b", &value, &array, &strict) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 3)
|
||||
Z_PARAM_ZVAL(value)
|
||||
Z_PARAM_ARRAY(array)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_BOOL(strict)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (strict) {
|
||||
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(array), num_idx, str_idx, entry) {
|
||||
@@ -1799,18 +1731,12 @@ PHP_FUNCTION(extract)
|
||||
zend_array *symbol_table;
|
||||
zval var_array;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|lz/", &var_array_param, &extract_type, &prefix) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 3)
|
||||
Z_PARAM_ARRAY(var_array_param)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_LONG(extract_type)
|
||||
Z_PARAM_ZVAL_EX(prefix, 0, 1)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
extract_refs = (extract_type & EXTR_REFS);
|
||||
if (extract_refs) {
|
||||
@@ -2040,17 +1966,11 @@ PHP_FUNCTION(array_fill)
|
||||
zval *val;
|
||||
zend_long start_key, num;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "llz", &start_key, &num, &val) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(3, 3)
|
||||
Z_PARAM_LONG(start_key)
|
||||
Z_PARAM_LONG(num)
|
||||
Z_PARAM_ZVAL(val)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (EXPECTED(num > 0)) {
|
||||
if (sizeof(num) > 4 && UNEXPECTED(EXPECTED(num > 0x7fffffff))) {
|
||||
@@ -2640,15 +2560,9 @@ PHP_FUNCTION(array_pop)
|
||||
uint32_t idx;
|
||||
Bucket *p;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/", &stack) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_ARRAY_EX(stack, 0, 1)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (zend_hash_num_elements(Z_ARRVAL_P(stack)) == 0) {
|
||||
return;
|
||||
@@ -2701,15 +2615,9 @@ PHP_FUNCTION(array_shift)
|
||||
uint32_t idx;
|
||||
Bucket *p;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/", &stack) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_ARRAY_EX(stack, 0, 1)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (zend_hash_num_elements(Z_ARRVAL_P(stack)) == 0) {
|
||||
return;
|
||||
@@ -2952,11 +2860,6 @@ PHP_FUNCTION(array_slice)
|
||||
zend_string *string_key;
|
||||
zend_ulong num_key;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "al|zb", &input, &offset, &z_length, &preserve_keys) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 4)
|
||||
Z_PARAM_ARRAY(input)
|
||||
Z_PARAM_LONG(offset)
|
||||
@@ -2964,7 +2867,6 @@ PHP_FUNCTION(array_slice)
|
||||
Z_PARAM_ZVAL(z_length)
|
||||
Z_PARAM_BOOL(preserve_keys)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
/* Get number of entries in the input hash */
|
||||
num_in = zend_hash_num_elements(Z_ARRVAL_P(input));
|
||||
@@ -3233,15 +3135,9 @@ static inline void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETE
|
||||
zval *arg;
|
||||
int argc, i;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, -1)
|
||||
Z_PARAM_VARIADIC('+', args, argc)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
for (i = 0; i < argc; i++) {
|
||||
zval *arg = args + i;
|
||||
@@ -3373,18 +3269,12 @@ PHP_FUNCTION(array_keys)
|
||||
zend_ulong num_idx;
|
||||
zend_string *str_idx;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "a|zb", &input, &search_value, &strict) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 3)
|
||||
Z_PARAM_ARRAY(input)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_ZVAL(search_value)
|
||||
Z_PARAM_BOOL(strict)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
/* Initialize return array */
|
||||
if (search_value != NULL) {
|
||||
@@ -3442,15 +3332,9 @@ 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)));
|
||||
@@ -5427,16 +5311,10 @@ PHP_FUNCTION(array_map)
|
||||
int i;
|
||||
uint32_t k, maxlen = 0;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "f!+", &fci, &fci_cache, &arrays, &n_arrays) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, -1)
|
||||
Z_PARAM_FUNC_EX(fci, fci_cache, 1, 0)
|
||||
Z_PARAM_VARIADIC('+', arrays, n_arrays)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
RETVAL_NULL();
|
||||
|
||||
@@ -5585,16 +5463,10 @@ PHP_FUNCTION(array_key_exists)
|
||||
zval *key; /* key to check for */
|
||||
HashTable *array; /* array to check in */
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zH", &key, &array) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 2)
|
||||
Z_PARAM_ZVAL(key)
|
||||
Z_PARAM_ARRAY_OR_OBJECT_HT(array)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
switch (Z_TYPE_P(key)) {
|
||||
case IS_STRING:
|
||||
|
||||
@@ -4815,16 +4815,10 @@ PHP_FUNCTION(call_user_func)
|
||||
zend_fcall_info fci;
|
||||
zend_fcall_info_cache fci_cache;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "f*", &fci, &fci_cache, &fci.params, &fci.param_count) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, -1)
|
||||
Z_PARAM_FUNC(fci, fci_cache)
|
||||
Z_PARAM_VARIADIC('*', fci.params, fci.param_count)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
fci.retval = &retval;
|
||||
|
||||
@@ -4843,16 +4837,10 @@ PHP_FUNCTION(call_user_func_array)
|
||||
zend_fcall_info fci;
|
||||
zend_fcall_info_cache fci_cache;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "fa/", &fci, &fci_cache, ¶ms) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 2)
|
||||
Z_PARAM_FUNC(fci, fci_cache)
|
||||
Z_PARAM_ARRAY_EX(params, 0, 1)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
zend_fcall_info_args(&fci, params);
|
||||
fci.retval = &retval;
|
||||
|
||||
@@ -884,15 +884,9 @@ PHPAPI PHP_FUNCTION(fclose)
|
||||
zval *res;
|
||||
php_stream *stream;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_RESOURCE(res)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
||||
#endif
|
||||
|
||||
PHP_STREAM_TO_ZVAL(stream, res);
|
||||
|
||||
@@ -980,15 +974,9 @@ PHPAPI PHP_FUNCTION(feof)
|
||||
zval *res;
|
||||
php_stream *stream;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_RESOURCE(res)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
||||
#endif
|
||||
|
||||
PHP_STREAM_TO_ZVAL(stream, res);
|
||||
|
||||
@@ -1012,17 +1000,11 @@ PHPAPI PHP_FUNCTION(fgets)
|
||||
zend_string *str;
|
||||
php_stream *stream;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &res, &len) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 2)
|
||||
Z_PARAM_RESOURCE(res)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_LONG(len)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
||||
#endif
|
||||
|
||||
PHP_STREAM_TO_ZVAL(stream, res);
|
||||
|
||||
@@ -1184,18 +1166,12 @@ PHPAPI PHP_FUNCTION(fwrite)
|
||||
zend_long maxlen = 0;
|
||||
php_stream *stream;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|l", &res, &input, &inputlen, &maxlen) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 3)
|
||||
Z_PARAM_RESOURCE(res)
|
||||
Z_PARAM_STRING(input, inputlen)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_LONG(maxlen)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
||||
#endif
|
||||
|
||||
if (ZEND_NUM_ARGS() == 2) {
|
||||
num_bytes = inputlen;
|
||||
@@ -1225,15 +1201,9 @@ PHPAPI PHP_FUNCTION(fflush)
|
||||
int ret;
|
||||
php_stream *stream;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_RESOURCE(res)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
||||
#endif
|
||||
|
||||
PHP_STREAM_TO_ZVAL(stream, res);
|
||||
|
||||
@@ -1252,15 +1222,9 @@ PHPAPI PHP_FUNCTION(rewind)
|
||||
zval *res;
|
||||
php_stream *stream;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_RESOURCE(res)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
||||
#endif
|
||||
|
||||
PHP_STREAM_TO_ZVAL(stream, res);
|
||||
|
||||
@@ -1279,15 +1243,9 @@ PHPAPI PHP_FUNCTION(ftell)
|
||||
zend_long ret;
|
||||
php_stream *stream;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &res) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_RESOURCE(res)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
||||
#endif
|
||||
|
||||
PHP_STREAM_TO_ZVAL(stream, res);
|
||||
|
||||
@@ -1307,18 +1265,12 @@ PHPAPI PHP_FUNCTION(fseek)
|
||||
zend_long offset, whence = SEEK_SET;
|
||||
php_stream *stream;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|l", &res, &offset, &whence) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 3)
|
||||
Z_PARAM_RESOURCE(res)
|
||||
Z_PARAM_LONG(offset)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_LONG(whence)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
||||
#endif
|
||||
|
||||
PHP_STREAM_TO_ZVAL(stream, res);
|
||||
|
||||
@@ -1802,16 +1754,10 @@ PHPAPI PHP_FUNCTION(fread)
|
||||
zend_long len;
|
||||
php_stream *stream;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &res, &len) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 2)
|
||||
Z_PARAM_RESOURCE(res)
|
||||
Z_PARAM_LONG(len)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
||||
#endif
|
||||
|
||||
PHP_STREAM_TO_ZVAL(stream, res);
|
||||
|
||||
@@ -2356,15 +2302,9 @@ PHP_FUNCTION(realpath)
|
||||
size_t filename_len;
|
||||
char resolved_path_buff[MAXPATHLEN];
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_PATH(filename, filename_len)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (VCWD_REALPATH(filename, resolved_path_buff)) {
|
||||
if (php_check_open_basedir(resolved_path_buff)) {
|
||||
|
||||
@@ -1001,20 +1001,7 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ
|
||||
|
||||
/* another quickie macro to make defining similar functions easier */
|
||||
/* {{{ FileFunction(name, funcnum) */
|
||||
#ifndef FAST_ZPP
|
||||
# define FileFunction(name, funcnum) \
|
||||
void name(INTERNAL_FUNCTION_PARAMETERS) { \
|
||||
char *filename; \
|
||||
size_t filename_len; \
|
||||
\
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) { \
|
||||
return; \
|
||||
} \
|
||||
\
|
||||
php_stat(filename, (php_stat_len) filename_len, funcnum, return_value); \
|
||||
}
|
||||
#else
|
||||
# define FileFunction(name, funcnum) \
|
||||
#define FileFunction(name, funcnum) \
|
||||
void name(INTERNAL_FUNCTION_PARAMETERS) { \
|
||||
char *filename; \
|
||||
size_t filename_len; \
|
||||
@@ -1025,7 +1012,6 @@ void name(INTERNAL_FUNCTION_PARAMETERS) { \
|
||||
\
|
||||
php_stat(filename, (php_stat_len) filename_len, funcnum, return_value); \
|
||||
}
|
||||
#endif
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto int fileperms(string filename)
|
||||
|
||||
@@ -395,15 +395,9 @@ php_formatted_print(zend_execute_data *execute_data, int use_array, int format_o
|
||||
int always_sign;
|
||||
size_t format_len;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) {
|
||||
return NULL;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, -1)
|
||||
Z_PARAM_VARIADIC('+', args, argc)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(return NULL);
|
||||
#endif
|
||||
|
||||
/* verify the number of args */
|
||||
if ((use_array && argc != (2 + format_offset))
|
||||
|
||||
@@ -1449,11 +1449,6 @@ 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(), "S|lS!b", &str, &flags, &hint_charset, &double_encode) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 4)
|
||||
Z_PARAM_STR(str)
|
||||
Z_PARAM_OPTIONAL
|
||||
@@ -1461,7 +1456,6 @@ static void php_html_entities(INTERNAL_FUNCTION_PARAMETERS, int all)
|
||||
Z_PARAM_STR_EX(hint_charset, 1, 0)
|
||||
Z_PARAM_BOOL(double_encode);
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (!hint_charset) {
|
||||
default_charset = get_default_charset();
|
||||
@@ -1531,19 +1525,12 @@ PHP_FUNCTION(html_entity_decode)
|
||||
zend_long quote_style = ENT_COMPAT;
|
||||
zend_string *replaced;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|lS", &str,
|
||||
"e_style, &hint_charset) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 3)
|
||||
Z_PARAM_STR(str)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_LONG(quote_style)
|
||||
Z_PARAM_STR(hint_charset)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (!hint_charset) {
|
||||
default_charset = get_default_charset();
|
||||
|
||||
@@ -290,15 +290,9 @@ PHP_FUNCTION(abs)
|
||||
{
|
||||
zval *value;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_ZVAL(value)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
convert_scalar_to_number_ex(value);
|
||||
|
||||
@@ -321,15 +315,9 @@ PHP_FUNCTION(ceil)
|
||||
{
|
||||
zval *value;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_ZVAL(value)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
convert_scalar_to_number_ex(value);
|
||||
|
||||
@@ -348,15 +336,9 @@ PHP_FUNCTION(floor)
|
||||
{
|
||||
zval *value;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_ZVAL(value)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
convert_scalar_to_number_ex(value);
|
||||
|
||||
@@ -423,15 +405,9 @@ PHP_FUNCTION(sin)
|
||||
{
|
||||
double num;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_DOUBLE(num)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
RETURN_DOUBLE(sin(num));
|
||||
}
|
||||
/* }}} */
|
||||
@@ -442,15 +418,9 @@ PHP_FUNCTION(cos)
|
||||
{
|
||||
double num;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_DOUBLE(num)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
RETURN_DOUBLE(cos(num));
|
||||
}
|
||||
/* }}} */
|
||||
@@ -461,15 +431,9 @@ PHP_FUNCTION(tan)
|
||||
{
|
||||
double num;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_DOUBLE(num)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
RETURN_DOUBLE(tan(num));
|
||||
}
|
||||
/* }}} */
|
||||
@@ -480,15 +444,9 @@ PHP_FUNCTION(asin)
|
||||
{
|
||||
double num;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_DOUBLE(num)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
RETURN_DOUBLE(asin(num));
|
||||
}
|
||||
/* }}} */
|
||||
@@ -499,15 +457,9 @@ PHP_FUNCTION(acos)
|
||||
{
|
||||
double num;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_DOUBLE(num)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
RETURN_DOUBLE(acos(num));
|
||||
}
|
||||
/* }}} */
|
||||
@@ -518,15 +470,9 @@ PHP_FUNCTION(atan)
|
||||
{
|
||||
double num;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_DOUBLE(num)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
RETURN_DOUBLE(atan(num));
|
||||
}
|
||||
/* }}} */
|
||||
@@ -537,16 +483,10 @@ PHP_FUNCTION(atan2)
|
||||
{
|
||||
double num1, num2;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "dd", &num1, &num2) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 2)
|
||||
Z_PARAM_DOUBLE(num1)
|
||||
Z_PARAM_DOUBLE(num2)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
RETURN_DOUBLE(atan2(num1, num2));
|
||||
}
|
||||
/* }}} */
|
||||
@@ -557,15 +497,9 @@ PHP_FUNCTION(sinh)
|
||||
{
|
||||
double num;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_DOUBLE(num)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
RETURN_DOUBLE(sinh(num));
|
||||
}
|
||||
/* }}} */
|
||||
@@ -576,15 +510,9 @@ PHP_FUNCTION(cosh)
|
||||
{
|
||||
double num;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_DOUBLE(num)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
RETURN_DOUBLE(cosh(num));
|
||||
}
|
||||
/* }}} */
|
||||
@@ -595,15 +523,9 @@ PHP_FUNCTION(tanh)
|
||||
{
|
||||
double num;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_DOUBLE(num)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
RETURN_DOUBLE(tanh(num));
|
||||
}
|
||||
/* }}} */
|
||||
@@ -614,15 +536,9 @@ PHP_FUNCTION(asinh)
|
||||
{
|
||||
double num;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_DOUBLE(num)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
RETURN_DOUBLE(php_asinh(num));
|
||||
}
|
||||
/* }}} */
|
||||
@@ -633,15 +549,9 @@ PHP_FUNCTION(acosh)
|
||||
{
|
||||
double num;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_DOUBLE(num)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
RETURN_DOUBLE(php_acosh(num));
|
||||
}
|
||||
/* }}} */
|
||||
@@ -652,15 +562,9 @@ PHP_FUNCTION(atanh)
|
||||
{
|
||||
double num;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_DOUBLE(num)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
RETURN_DOUBLE(php_atanh(num));
|
||||
}
|
||||
/* }}} */
|
||||
@@ -679,15 +583,9 @@ PHP_FUNCTION(is_finite)
|
||||
{
|
||||
double dval;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &dval) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_DOUBLE(dval)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
RETURN_BOOL(zend_finite(dval));
|
||||
}
|
||||
/* }}} */
|
||||
@@ -698,15 +596,9 @@ PHP_FUNCTION(is_infinite)
|
||||
{
|
||||
double dval;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &dval) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_DOUBLE(dval)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
RETURN_BOOL(zend_isinf(dval));
|
||||
}
|
||||
/* }}} */
|
||||
@@ -717,15 +609,9 @@ PHP_FUNCTION(is_nan)
|
||||
{
|
||||
double dval;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &dval) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_DOUBLE(dval)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
RETURN_BOOL(zend_isnan(dval));
|
||||
}
|
||||
/* }}} */
|
||||
@@ -750,15 +636,9 @@ PHP_FUNCTION(exp)
|
||||
{
|
||||
double num;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_DOUBLE(num)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
RETURN_DOUBLE(exp(num));
|
||||
}
|
||||
@@ -774,15 +654,9 @@ PHP_FUNCTION(expm1)
|
||||
{
|
||||
double num;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_DOUBLE(num)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
RETURN_DOUBLE(php_expm1(num));
|
||||
}
|
||||
@@ -798,15 +672,9 @@ PHP_FUNCTION(log1p)
|
||||
{
|
||||
double num;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_DOUBLE(num)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
RETURN_DOUBLE(php_log1p(num));
|
||||
}
|
||||
@@ -818,17 +686,11 @@ PHP_FUNCTION(log)
|
||||
{
|
||||
double num, base = 0;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "d|d", &num, &base) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 2)
|
||||
Z_PARAM_DOUBLE(num)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_DOUBLE(base)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (ZEND_NUM_ARGS() == 1) {
|
||||
RETURN_DOUBLE(log(num));
|
||||
@@ -863,15 +725,9 @@ PHP_FUNCTION(log10)
|
||||
{
|
||||
double num;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_DOUBLE(num)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
RETURN_DOUBLE(log10(num));
|
||||
}
|
||||
@@ -883,15 +739,9 @@ PHP_FUNCTION(sqrt)
|
||||
{
|
||||
double num;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_DOUBLE(num)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
RETURN_DOUBLE(sqrt(num));
|
||||
}
|
||||
@@ -903,16 +753,10 @@ PHP_FUNCTION(hypot)
|
||||
{
|
||||
double num1, num2;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "dd", &num1, &num2) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 2)
|
||||
Z_PARAM_DOUBLE(num1)
|
||||
Z_PARAM_DOUBLE(num2)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
#if HAVE_HYPOT
|
||||
RETURN_DOUBLE(hypot(num1, num2));
|
||||
@@ -930,15 +774,9 @@ PHP_FUNCTION(deg2rad)
|
||||
{
|
||||
double deg;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", °) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_DOUBLE(deg)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
RETURN_DOUBLE((deg / 180.0) * M_PI);
|
||||
}
|
||||
/* }}} */
|
||||
@@ -949,15 +787,9 @@ PHP_FUNCTION(rad2deg)
|
||||
{
|
||||
double rad;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &rad) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_DOUBLE(rad)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
RETURN_DOUBLE((rad / M_PI) * 180);
|
||||
}
|
||||
@@ -1395,11 +1227,6 @@ PHP_FUNCTION(number_format)
|
||||
char thousand_sep_chr = ',', dec_point_chr = '.';
|
||||
size_t thousand_sep_len = 0, dec_point_len = 0;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "d|ls!s!", &num, &dec, &dec_point, &dec_point_len, &thousand_sep, &thousand_sep_len) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 4)
|
||||
Z_PARAM_DOUBLE(num)
|
||||
Z_PARAM_OPTIONAL
|
||||
@@ -1407,7 +1234,6 @@ PHP_FUNCTION(number_format)
|
||||
Z_PARAM_STRING_EX(dec_point, dec_point_len, 1, 0)
|
||||
Z_PARAM_STRING_EX(thousand_sep, thousand_sep_len, 1, 0)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
switch(ZEND_NUM_ARGS()) {
|
||||
case 1:
|
||||
@@ -1443,16 +1269,10 @@ PHP_FUNCTION(fmod)
|
||||
{
|
||||
double num1, num2;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "dd", &num1, &num2) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 2)
|
||||
Z_PARAM_DOUBLE(num1)
|
||||
Z_PARAM_DOUBLE(num2)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
RETURN_DOUBLE(fmod(num1, num2));
|
||||
}
|
||||
|
||||
@@ -247,18 +247,12 @@ PHP_FUNCTION(stream_socket_accept)
|
||||
zval *zstream;
|
||||
zend_string *errstr = NULL;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|dz/", &zstream, &timeout, &zpeername) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 3)
|
||||
Z_PARAM_RESOURCE(zstream)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_DOUBLE(timeout)
|
||||
Z_PARAM_ZVAL_EX(zpeername, 0, 1)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
||||
#endif
|
||||
|
||||
php_stream_from_zval(stream, zstream);
|
||||
|
||||
@@ -306,16 +300,10 @@ PHP_FUNCTION(stream_socket_get_name)
|
||||
zend_bool want_peer;
|
||||
zend_string *name = NULL;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rb", &zstream, &want_peer) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 2)
|
||||
Z_PARAM_RESOURCE(zstream)
|
||||
Z_PARAM_BOOL(want_peer)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
||||
#endif
|
||||
|
||||
php_stream_from_zval(stream, zstream);
|
||||
|
||||
@@ -493,15 +481,9 @@ PHP_FUNCTION(stream_get_meta_data)
|
||||
zval *zstream;
|
||||
php_stream *stream;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zstream) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_RESOURCE(zstream)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
php_stream_from_zval(stream, zstream);
|
||||
|
||||
@@ -746,11 +728,6 @@ PHP_FUNCTION(stream_select)
|
||||
zend_bool secnull;
|
||||
int set_count, max_set_count = 0;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/!a/!a/!l!|l", &r_array, &w_array, &e_array, &sec, &secnull, &usec) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(4, 5)
|
||||
Z_PARAM_ARRAY_EX(r_array, 1, 1)
|
||||
Z_PARAM_ARRAY_EX(w_array, 1, 1)
|
||||
@@ -759,7 +736,6 @@ PHP_FUNCTION(stream_select)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_LONG(usec)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
FD_ZERO(&rfds);
|
||||
FD_ZERO(&wfds);
|
||||
@@ -965,15 +941,9 @@ PHP_FUNCTION(stream_context_get_options)
|
||||
zval *zcontext;
|
||||
php_stream_context *context;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zcontext) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_RESOURCE(zcontext)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
||||
#endif
|
||||
|
||||
context = decode_context_param(zcontext);
|
||||
if (!context) {
|
||||
@@ -995,16 +965,10 @@ PHP_FUNCTION(stream_context_set_option)
|
||||
if (ZEND_NUM_ARGS() == 2) {
|
||||
zval *options;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ra", &zcontext, &options) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 2)
|
||||
Z_PARAM_RESOURCE(zcontext)
|
||||
Z_PARAM_ARRAY(options)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
||||
#endif
|
||||
|
||||
/* figure out where the context is coming from exactly */
|
||||
if (!(context = decode_context_param(zcontext))) {
|
||||
@@ -1018,18 +982,12 @@ PHP_FUNCTION(stream_context_set_option)
|
||||
char *wrappername, *optionname;
|
||||
size_t wrapperlen, optionlen;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rssz", &zcontext, &wrappername, &wrapperlen, &optionname, &optionlen, &zvalue) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(4, 4)
|
||||
Z_PARAM_RESOURCE(zcontext)
|
||||
Z_PARAM_STRING(wrappername, wrapperlen)
|
||||
Z_PARAM_STRING(optionname, optionlen)
|
||||
Z_PARAM_ZVAL(zvalue)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
||||
#endif
|
||||
|
||||
/* figure out where the context is coming from exactly */
|
||||
if (!(context = decode_context_param(zcontext))) {
|
||||
@@ -1049,16 +1007,10 @@ PHP_FUNCTION(stream_context_set_params)
|
||||
zval *params, *zcontext;
|
||||
php_stream_context *context;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ra", &zcontext, ¶ms) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 2)
|
||||
Z_PARAM_RESOURCE(zcontext)
|
||||
Z_PARAM_ARRAY(params)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
||||
#endif
|
||||
|
||||
context = decode_context_param(zcontext);
|
||||
if (!context) {
|
||||
@@ -1077,15 +1029,9 @@ PHP_FUNCTION(stream_context_get_params)
|
||||
zval *zcontext;
|
||||
php_stream_context *context;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zcontext) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_RESOURCE(zcontext)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
||||
#endif
|
||||
|
||||
context = decode_context_param(zcontext);
|
||||
if (!context) {
|
||||
@@ -1341,16 +1287,10 @@ PHP_FUNCTION(stream_set_blocking)
|
||||
zend_bool block;
|
||||
php_stream *stream;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rb", &zstream, &block) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 2)
|
||||
Z_PARAM_RESOURCE(zstream)
|
||||
Z_PARAM_BOOL(block)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
php_stream_from_zval(stream, zstream);
|
||||
|
||||
@@ -1511,11 +1451,6 @@ PHP_FUNCTION(stream_socket_enable_crypto)
|
||||
zend_bool enable, cryptokindnull;
|
||||
int ret;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rb|l!r", &zstream, &enable, &cryptokind, &cryptokindnull, &zsessstream) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 4)
|
||||
Z_PARAM_RESOURCE(zstream)
|
||||
Z_PARAM_BOOL(enable)
|
||||
@@ -1523,7 +1458,6 @@ PHP_FUNCTION(stream_socket_enable_crypto)
|
||||
Z_PARAM_LONG_EX(cryptokind, cryptokindnull, 1, 0)
|
||||
Z_PARAM_RESOURCE(zsessstream)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
||||
#endif
|
||||
|
||||
php_stream_from_zval(stream, zstream);
|
||||
|
||||
@@ -1648,16 +1582,10 @@ PHP_FUNCTION(stream_socket_shutdown)
|
||||
zval *zstream;
|
||||
php_stream *stream;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &zstream, &how) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(2, 2)
|
||||
Z_PARAM_RESOURCE(zstream)
|
||||
Z_PARAM_LONG(how)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
||||
#endif
|
||||
|
||||
if (how != STREAM_SHUT_RD &&
|
||||
how != STREAM_SHUT_WR &&
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -133,17 +133,11 @@ PHP_FUNCTION(intval)
|
||||
if (ZEND_NUM_ARGS() != 1 && ZEND_NUM_ARGS() != 2) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|l", &num, &base) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 2)
|
||||
Z_PARAM_ZVAL(num)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_LONG(base)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
if (Z_TYPE_P(num) != IS_STRING || base == 10) {
|
||||
RETVAL_LONG(zval_get_long(num));
|
||||
@@ -187,15 +181,9 @@ 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));
|
||||
}
|
||||
@@ -205,16 +193,9 @@ static inline void php_is_type(INTERNAL_FUNCTION_PARAMETERS, int type)
|
||||
{
|
||||
zval *arg;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
ZVAL_DEREF(arg);
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_ZVAL_DEREF(arg)
|
||||
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
|
||||
#endif
|
||||
|
||||
if (Z_TYPE_P(arg) == type) {
|
||||
if (type == IS_RESOURCE) {
|
||||
@@ -315,15 +296,9 @@ 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:
|
||||
@@ -352,15 +327,9 @@ PHP_FUNCTION(is_scalar)
|
||||
{
|
||||
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_FALSE:
|
||||
|
||||
@@ -551,15 +551,9 @@ PHP_FUNCTION(urlencode)
|
||||
{
|
||||
zend_string *in_str;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &in_str) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_STR(in_str)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
RETURN_STR(php_url_encode(ZSTR_VAL(in_str), ZSTR_LEN(in_str)));
|
||||
}
|
||||
@@ -571,15 +565,9 @@ PHP_FUNCTION(urldecode)
|
||||
{
|
||||
zend_string *in_str, *out_str;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &in_str) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_STR(in_str)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
out_str = zend_string_init(ZSTR_VAL(in_str), ZSTR_LEN(in_str), 0);
|
||||
ZSTR_LEN(out_str) = php_url_decode(ZSTR_VAL(out_str), ZSTR_LEN(out_str));
|
||||
@@ -658,15 +646,9 @@ PHP_FUNCTION(rawurlencode)
|
||||
{
|
||||
zend_string *in_str;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &in_str) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_STR(in_str)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
RETURN_STR(php_raw_url_encode(ZSTR_VAL(in_str), ZSTR_LEN(in_str)));
|
||||
}
|
||||
@@ -678,15 +660,9 @@ PHP_FUNCTION(rawurldecode)
|
||||
{
|
||||
zend_string *in_str, *out_str;
|
||||
|
||||
#ifndef FAST_ZPP
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &in_str) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
#else
|
||||
ZEND_PARSE_PARAMETERS_START(1, 1)
|
||||
Z_PARAM_STR(in_str)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
#endif
|
||||
|
||||
out_str = zend_string_init(ZSTR_VAL(in_str), ZSTR_LEN(in_str), 0);
|
||||
ZSTR_LEN(out_str) = php_raw_url_decode(ZSTR_VAL(out_str), ZSTR_LEN(out_str));
|
||||
|
||||
Reference in New Issue
Block a user