static zend_class_entry *dir_class_entry_ptr;
#define FETCH_DIRP() \
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &id) == FAILURE) { \
- return; \
- } \
+ ZEND_PARSE_PARAMETERS_START(0, 1) \
+ Z_PARAM_OPTIONAL \
+ Z_PARAM_RESOURCE(id) \
+ ZEND_PARSE_PARAMETERS_END(); \
if (ZEND_NUM_ARGS() == 0) { \
myself = getThis(); \
if (myself) { \
php_stream_context *context = NULL;
php_stream *dirp;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|r", &dirname, &dir_len, &zcontext) == FAILURE) {
- RETURN_NULL();
- }
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_PATH(dirname, dir_len)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_RESOURCE(zcontext)
+ ZEND_PARSE_PARAMETERS_END();
context = php_stream_context_from_zval(zcontext, 0);
int ret;
size_t str_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &str, &str_len) == FAILURE) {
- RETURN_FALSE;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_PATH(str, str_len)
+ ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
ret = chroot(str);
if (ret != 0) {
int ret;
size_t str_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &str, &str_len) == FAILURE) {
- RETURN_FALSE;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_PATH(str, str_len)
+ ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
if (php_check_open_basedir(str)) {
RETURN_FALSE;
int ret;
zend_bool basedir_limit = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|l", &pattern, &pattern_len, &flags) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_PATH(pattern, pattern_len)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(flags)
+ ZEND_PARSE_PARAMETERS_END();
if (pattern_len >= MAXPATHLEN) {
php_error_docref(NULL, E_WARNING, "Pattern exceeds the maximum allowed length of %d characters", MAXPATHLEN);
zval *zcontext = NULL;
php_stream_context *context = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|lr", &dirn, &dirn_len, &flags, &zcontext) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_PATH(dirn, dirn_len)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(flags)
+ Z_PARAM_RESOURCE(zcontext)
+ ZEND_PARSE_PARAMETERS_END();
if (dirn_len < 1) {
php_error_docref(NULL, E_WARNING, "Directory name cannot be empty");
sapi_header_line ctr = {0};
size_t len;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|bl", &ctr.line,
- &len, &rep, &ctr.response_code) == FAILURE)
- return;
+ ZEND_PARSE_PARAMETERS_START(1, 3)
+ Z_PARAM_STRING(ctr.line, len)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_BOOL(rep)
+ Z_PARAM_LONG(ctr.response_code)
+ ZEND_PARSE_PARAMETERS_END();
ctr.line_len = (uint32_t)len;
sapi_header_op(rep ? SAPI_HEADER_REPLACE:SAPI_HEADER_ADD, &ctr);
sapi_header_line ctr = {0};
size_t len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &ctr.line,
- &len) == FAILURE)
- return;
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_STRING(ctr.line, len)
+ ZEND_PARSE_PARAMETERS_END();
ctr.line_len = (uint32_t)len;
sapi_header_op(ZEND_NUM_ARGS() == 0 ? SAPI_HEADER_DELETE_ALL : SAPI_HEADER_DELETE, &ctr);
zend_long expires = 0;
zend_bool secure = 0, httponly = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|SlSSbb",
- &name, &value, &expires, &path, &domain, &secure, &httponly) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 7)
+ Z_PARAM_STR(name)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR(value)
+ Z_PARAM_LONG(expires)
+ Z_PARAM_STR(path)
+ Z_PARAM_STR(domain)
+ Z_PARAM_BOOL(secure)
+ Z_PARAM_BOOL(httponly)
+ ZEND_PARSE_PARAMETERS_END();
if (php_setcookie(name, value, expires, path, domain, secure, 1, httponly) == SUCCESS) {
RETVAL_TRUE;
zend_long expires = 0;
zend_bool secure = 0, httponly = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|SlSSbb",
- &name, &value, &expires, &path, &domain, &secure, &httponly) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 7)
+ Z_PARAM_STR(name)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STR(value)
+ Z_PARAM_LONG(expires)
+ Z_PARAM_STR(path)
+ Z_PARAM_STR(domain)
+ Z_PARAM_BOOL(secure)
+ Z_PARAM_BOOL(httponly)
+ ZEND_PARSE_PARAMETERS_END();
if (php_setcookie(name, value, expires, path, domain, secure, 0, httponly) == SUCCESS) {
RETVAL_TRUE;
const char *file="";
int line=0;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z/z/", &arg1, &arg2) == FAILURE)
- return;
+ ZEND_PARSE_PARAMETERS_START(0, 2)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_ZVAL_DEREF_EX(arg1, 0, 1)
+ Z_PARAM_ZVAL_DEREF_EX(arg2, 0, 1)
+ ZEND_PARSE_PARAMETERS_END();
if (SG(headers_sent)) {
line = php_output_get_start_lineno();
{
zend_long response_code = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &response_code) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_LONG(response_code)
+ ZEND_PARSE_PARAMETERS_END();
if (response_code)
{
smart_str formstr = {0};
zend_long enc_type = PHP_QUERY_RFC1738;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|ssl", &formdata, &prefix, &prefix_len, &arg_sep, &arg_sep_len, &enc_type) != SUCCESS) {
- RETURN_FALSE;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 4)
+ Z_PARAM_ZVAL_DEREF(formdata)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STRING(prefix, prefix_len)
+ Z_PARAM_STRING(arg_sep, arg_sep_len)
+ Z_PARAM_LONG(enc_type)
+ ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
if (Z_TYPE_P(formdata) != IS_ARRAY && Z_TYPE_P(formdata) != IS_OBJECT) {
php_error_docref(NULL, E_WARNING, "Parameter 1 expected to be Array or Object. Incorrect value given");
RETURN_LONG(php_mt_rand() >> 1);
}
- if (zend_parse_parameters(argc, "ll", &min, &max) == FAILURE) {
- return;
- }
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_LONG(min)
+ Z_PARAM_LONG(max)
+ ZEND_PARSE_PARAMETERS_END();
if (max < min) {
RETURN_LONG(php_mt_rand_common(max, min));
php_stream_bucket_brigade *brigade;
php_stream_bucket *bucket;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &zbrigade) == FAILURE) {
- RETURN_FALSE;
- }
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_RESOURCE(zbrigade)
+ ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
if ((brigade = (php_stream_bucket_brigade*)zend_fetch_resource(
Z_RES_P(zbrigade), PHP_STREAM_BRIGADE_RES_NAME, le_bucket_brigade)) == NULL) {
php_stream_bucket_brigade *brigade;
php_stream_bucket *bucket;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "ro", &zbrigade, &zobject) == FAILURE) {
- RETURN_FALSE;
- }
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_RESOURCE(zbrigade)
+ Z_PARAM_OBJECT(zobject)
+ ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
if (NULL == (pzbucket = zend_hash_str_find(Z_OBJPROP_P(zobject), "bucket", sizeof("bucket")-1))) {
php_error_docref(NULL, E_WARNING, "Object has no bucket property");
size_t buffer_len;
php_stream_bucket *bucket;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "zs", &zstream, &buffer, &buffer_len) == FAILURE) {
- RETURN_FALSE;
- }
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_ZVAL_DEREF(zstream)
+ Z_PARAM_STRING(buffer, buffer_len)
+ ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
php_stream_from_zval(stream, zstream);
zend_string *filtername, *classname;
struct php_user_filter_data *fdat;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &filtername, &classname) == FAILURE) {
- RETURN_FALSE;
- }
+ ZEND_PARSE_PARAMETERS_START(2, 2)
+ Z_PARAM_STR(filtername)
+ Z_PARAM_STR(classname)
+ ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
RETVAL_FALSE;