#define Z_PARAM_ARRAY(dest) \
Z_PARAM_ARRAY_EX(dest, 0, 0)
+#define Z_PARAM_ARRAY_OR_NULL(dest) \
+ Z_PARAM_ARRAY_EX(dest, 1, 0)
+
/* old "A" */
#define Z_PARAM_ARRAY_OR_OBJECT_EX2(dest, check_null, deref, separate) \
Z_PARAM_PROLOGUE(deref, separate); \
#define Z_PARAM_STRING(dest, dest_len) \
Z_PARAM_STRING_EX(dest, dest_len, 0, 0)
+#define Z_PARAM_STRING_OR_NULL(dest, dest_len) \
+ Z_PARAM_STRING_EX(dest, dest_len, 1, 0)
+
/* old "S" */
#define Z_PARAM_STR_EX2(dest, check_null, deref, separate) \
Z_PARAM_PROLOGUE(deref, separate); \
ZEND_PARSE_PARAMETERS_START(0, 2)
Z_PARAM_OPTIONAL
Z_PARAM_LONG(what)
- Z_PARAM_STRING_EX(option, option_len, 1, 0)
+ Z_PARAM_STRING_OR_NULL(option, option_len)
ZEND_PARSE_PARAMETERS_END();
/* Extra validation */
ZEND_PARSE_PARAMETERS_START(1, 4)
Z_PARAM_STRING(data_source, data_source_len)
Z_PARAM_OPTIONAL
- Z_PARAM_STRING_EX(username, usernamelen, 1, 0)
- Z_PARAM_STRING_EX(password, passwordlen, 1, 0)
- Z_PARAM_ARRAY_EX(options, 1, 0)
+ Z_PARAM_STRING_OR_NULL(username, usernamelen)
+ Z_PARAM_STRING_OR_NULL(password, passwordlen)
+ Z_PARAM_ARRAY_OR_NULL(options)
ZEND_PARSE_PARAMETERS_END();
/* parse the data source name */
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_STRING_EX(name, namelen, 1, 0)
+ Z_PARAM_STRING_OR_NULL(name, namelen)
ZEND_PARSE_PARAMETERS_END();
PDO_DBH_CLEAR_ERR();
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY_EX(input_params, 1, 0)
+ Z_PARAM_ARRAY_OR_NULL(input_params)
ZEND_PARSE_PARAMETERS_END();
PDO_STMT_CLEAR_ERR();
ZEND_PARSE_PARAMETERS_START(0, 2)
Z_PARAM_OPTIONAL
- Z_PARAM_STRING_EX(extname, extname_len, 1, 0)
+ Z_PARAM_STRING_OR_NULL(extname, extname_len)
Z_PARAM_BOOL(details)
ZEND_PARSE_PARAMETERS_END();
Z_PARAM_DOUBLE(num)
Z_PARAM_OPTIONAL
Z_PARAM_LONG(dec)
- Z_PARAM_STRING_EX(dec_point, dec_point_len, 1, 0)
- Z_PARAM_STRING_EX(thousand_sep, thousand_sep_len, 1, 0)
+ Z_PARAM_STRING_OR_NULL(dec_point, dec_point_len)
+ Z_PARAM_STRING_OR_NULL(thousand_sep, thousand_sep_len)
ZEND_PARSE_PARAMETERS_END();
switch(ZEND_NUM_ARGS()) {
Z_PARAM_ARRAY(descriptorspec)
Z_PARAM_ZVAL(pipes)
Z_PARAM_OPTIONAL
- Z_PARAM_STRING_EX(cwd, cwd_len, 1, 0)
- Z_PARAM_ARRAY_EX(environment, 1, 0)
- Z_PARAM_ARRAY_EX(other_options, 1, 0)
+ Z_PARAM_STRING_OR_NULL(cwd, cwd_len)
+ Z_PARAM_ARRAY_OR_NULL(environment)
+ Z_PARAM_ARRAY_OR_NULL(other_options)
ZEND_PARSE_PARAMETERS_END();
memset(&env, 0, sizeof(env));
ZEND_PARSE_PARAMETERS_START(0, 2)
Z_PARAM_OPTIONAL
- Z_PARAM_ARRAY_EX(options, 1, 0)
- Z_PARAM_ARRAY_EX(params, 1, 0)
+ Z_PARAM_ARRAY_OR_NULL(options)
+ Z_PARAM_ARRAY_OR_NULL(params)
ZEND_PARSE_PARAMETERS_END();
context = php_stream_context_alloc();