zval *c;
zend_class_entry *scope;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &const_name) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(const_name)
+ ZEND_PARSE_PARAMETERS_END();
scope = zend_get_executed_scope();
c = zend_get_constant_ex(const_name, scope, ZEND_FETCH_CLASS_SILENT);
int af = AF_INET;
char buffer[40];
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &address, &address_len) == FAILURE) {
- RETURN_FALSE;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STRING(address, address_len)
+ ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
#ifdef HAVE_IPV6
if (address_len == 16) {
size_t address_len;
char buffer[17];
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &address, &address_len) == FAILURE) {
- RETURN_FALSE;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STRING(address, address_len)
+ ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
memset(buffer, 0, sizeof(buffer));
zend_ulong ip;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &addr, &addr_len) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STRING(addr, addr_len)
+ ZEND_PARSE_PARAMETERS_END();
#ifdef HAVE_INET_PTON
if (addr_len == 0 || inet_pton(AF_INET, addr, &ip) != 1) {
PHP_FUNCTION(long2ip)
{
zend_ulong ip;
+ zend_long sip;
struct in_addr myaddr;
#ifdef HAVE_INET_PTON
char str[40];
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &ip) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(sip)
+ ZEND_PARSE_PARAMETERS_END();
+
+ /* autoboxes on 32bit platforms, but that's expected */
+ ip = (zend_ulong)sip;
myaddr.s_addr = htonl(ip);
#ifdef HAVE_INET_PTON
size_t str_len;
zend_bool local_only = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sb", &str, &str_len, &local_only) == FAILURE) {
- RETURN_FALSE;
- }
+ ZEND_PARSE_PARAMETERS_START(0, 2)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STRING(str, str_len)
+ Z_PARAM_BOOL(local_only)
+ ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
if (!str) {
array_init(return_value);
int error_code;
#endif
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &setting, &setting_len) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STRING(setting, setting_len)
+ ZEND_PARSE_PARAMETERS_END();
if(setting_len == 0 || setting[0] == '=') {
php_error_docref(NULL, E_WARNING, "Invalid parameter syntax");
int optname_len = 0;
opt_struct *opts, *orig_opts;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|az/", &options, &options_len, &p_longopts, &zoptind) == FAILURE) {
- RETURN_FALSE;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STRING(options, options_len)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ARRAY(p_longopts)
+ Z_PARAM_ZVAL_DEREF_EX(zoptind, 0, 1)
+ ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
/* Init zoptind to 1 */
if (zoptind) {
{
zend_long num;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &num) == FAILURE) {
- RETURN_FALSE;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(num)
+ ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
+
if (num < 0) {
php_error_docref(NULL, E_WARNING, "Number of seconds must be greater than or equal to 0");
RETURN_FALSE;
#if HAVE_USLEEP
zend_long num;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &num) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(num)
+ ZEND_PARSE_PARAMETERS_END();
+
if (num < 0) {
php_error_docref(NULL, E_WARNING, "Number of microseconds must be greater than or equal to 0");
RETURN_FALSE;
zend_long tv_sec, tv_nsec;
struct timespec php_req, php_rem;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &tv_sec, &tv_nsec) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_LONG(tv_sec)
+ Z_PARAM_LONG(tv_nsec)
+ ZEND_PARSE_PARAMETERS_END();
if (tv_sec < 0) {
php_error_docref(NULL, E_WARNING, "The seconds value must be greater than 0");
struct timeval tm;
struct timespec php_req, php_rem;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &d_ts) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_DOUBLE(d_ts)
+ ZEND_PARSE_PARAMETERS_END();
if (gettimeofday((struct timeval *) &tm, NULL) != 0) {
RETURN_FALSE;
size_t varname_len;
zval *retval;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &varname, &varname_len) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STRING(varname, varname_len)
+ ZEND_PARSE_PARAMETERS_END();
retval = cfg_get_entry(varname, (uint32_t)varname_len);
int opt_err = 0, argc = ZEND_NUM_ARGS();
zend_long erropt = 0;
- if (zend_parse_parameters(argc, "s|lps", &message, &message_len, &erropt, &opt, &opt_len, &headers, &headers_len) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 4)
+ Z_PARAM_STRING(message, message_len)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(erropt)
+ Z_PARAM_PATH(opt, opt_len)
+ Z_PARAM_STRING(headers, headers_len)
+ ZEND_PARSE_PARAMETERS_END();
if (argc > 1) {
opt_err = (int)erropt;
zend_fcall_info_cache fci_cache;
zend_class_entry *called_scope;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "f*", &fci, &fci_cache, &fci.params, &fci.param_count) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(1, -1)
+ Z_PARAM_FUNC(fci, fci_cache)
+ Z_PARAM_VARIADIC('*', fci.params, fci.param_count)
+ ZEND_PARSE_PARAMETERS_END();
if (!EX(prev_execute_data)->func->common.scope) {
zend_throw_error(NULL, "Cannot call forward_static_call() when no class scope is active");
zend_fcall_info_cache fci_cache;
zend_class_entry *called_scope;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "fa/", &fci, &fci_cache, ¶ms) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_FUNC(fci, fci_cache)
+ Z_PARAM_ARRAY_EX(params, 0, 1)
+ ZEND_PARSE_PARAMETERS_END();
zend_fcall_info_args(&fci, params);
fci.retval = &retval;
zend_syntax_highlighter_ini syntax_highlighter_ini;
zend_bool i = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|b", &filename, &filename_len, &i) == FAILURE) {
- RETURN_FALSE;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_PATH(filename, filename_len)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(i)
+ ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
if (php_check_open_basedir(filename)) {
RETURN_FALSE;
zend_lex_state original_lex_state;
zend_file_handle file_handle;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) {
- RETURN_FALSE;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_PATH(filename, filename_len)
+ ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
php_output_start_default();
zend_bool i = 0;
int old_error_reporting = EG(error_reporting);
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &expr, &i) == FAILURE) {
- RETURN_FALSE;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ZVAL_DEREF(expr)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(i)
+ ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
convert_to_string_ex(expr);
if (i) {
char *varname, *str;
size_t varname_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &varname, &varname_len) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STRING(varname, varname_len)
+ ZEND_PARSE_PARAMETERS_END();
str = zend_ini_string(varname, (uint32_t)varname_len, 0);
zend_module_entry *module;
zend_bool details = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!b", &extname, &extname_len, &details) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(0, 2)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STRING_EX(extname, extname_len, 1, 0)
+ Z_PARAM_BOOL(details)
+ ZEND_PARSE_PARAMETERS_END();
zend_ini_sort_entries();
zend_string *new_value;
char *old_value;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &varname, &new_value) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(varname)
+ Z_PARAM_STR(new_value)
+ ZEND_PARSE_PARAMETERS_END();
old_value = zend_ini_string(ZSTR_VAL(varname), (int)ZSTR_LEN(varname), 0);
{
zend_string *varname;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &varname) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STR(varname)
+ ZEND_PARSE_PARAMETERS_END();
zend_restore_ini_entry(varname, PHP_INI_STAGE_RUNTIME);
}
char *old_value;
zend_string *key;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "P", &new_value) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_PATH_STR(new_value)
+ ZEND_PARSE_PARAMETERS_END();
old_value = zend_ini_string("include_path", sizeof("include_path") - 1, 0);
/* copy to return here, because alter might free it! */
{
char *str;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE) {
+ if (zend_parse_parameters_none() == FAILURE) {
return;
}
{
zend_string *key;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "") == FAILURE) {
+ if (zend_parse_parameters_none() == FAILURE) {
return;
}
key = zend_string_init("include_path", sizeof("include_path")-1, 0);
zval *var;
zend_bool do_return = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|b", &var, &do_return) == FAILURE) {
- RETURN_FALSE;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_ZVAL_DEREF(var)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(do_return)
+ ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
if (do_return) {
RETURN_STR(zend_print_zval_r_to_str(var, 0));
zend_bool arg = 0;
int old_setting;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &arg) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(arg)
+ ZEND_PARSE_PARAMETERS_END();
old_setting = (unsigned short)PG(ignore_user_abort);
size_t name_len, proto_len;
struct servent *serv;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &name, &name_len, &proto, &proto_len) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STRING(name, name_len)
+ Z_PARAM_STRING(proto, proto_len)
+ ZEND_PARSE_PARAMETERS_END();
/* empty string behaves like NULL on windows implementation of
zend_long port;
struct servent *serv;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &port, &proto, &proto_len) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_LONG(port)
+ Z_PARAM_STRING(proto, proto_len)
+ ZEND_PARSE_PARAMETERS_END();
serv = getservbyport(htons((unsigned short) port), proto);
size_t name_len;
struct protoent *ent;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name, &name_len) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STRING(name, name_len)
+ ZEND_PARSE_PARAMETERS_END();
ent = getprotobyname(name);
zend_long proto;
struct protoent *ent;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &proto) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_LONG(proto)
+ ZEND_PARSE_PARAMETERS_END();
ent = getprotobynumber((int)proto);
zval *function;
user_tick_function_entry tick_fe;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "z/", &function) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_ZVAL_DEREF_EX(function, 0, 1)
+ ZEND_PARSE_PARAMETERS_END();
if (!BG(user_tick_functions)) {
return;
RETURN_FALSE;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &path, &path_len) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_STRING(path, path_len)
+ ZEND_PARSE_PARAMETERS_END();
if (zend_hash_str_exists(SG(rfc1867_uploaded_files), path, path_len)) {
RETURN_TRUE;
RETURN_FALSE;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "sp", &path, &path_len, &new_path, &new_path_len) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STRING(path, path_len)
+ Z_PARAM_PATH(new_path, new_path_len)
+ ZEND_PARSE_PARAMETERS_END();
if (!zend_hash_str_exists(SG(rfc1867_uploaded_files), path, path_len)) {
RETURN_FALSE;
zend_file_handle fh;
zend_ini_parser_cb_t ini_parser_cb;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|bl", &filename, &filename_len, &process_sections, &scanner_mode) == FAILURE) {
- RETURN_FALSE;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_PATH(filename, filename_len)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(process_sections)
+ Z_PARAM_LONG(scanner_mode)
+ ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
if (filename_len == 0) {
php_error_docref(NULL, E_WARNING, "Filename cannot be empty!");
zend_long scanner_mode = ZEND_INI_SCANNER_NORMAL;
zend_ini_parser_cb_t ini_parser_cb;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|bl", &str, &str_len, &process_sections, &scanner_mode) == FAILURE) {
- RETURN_FALSE;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STRING(str, str_len)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(process_sections)
+ Z_PARAM_LONG(scanner_mode)
+ ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
if (INT_MAX - str_len < ZEND_MMAP_AHEAD) {
RETVAL_FALSE;