summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/zend_API.h6
-rw-r--r--ext/date/php_date.c2
-rw-r--r--ext/pdo/pdo_dbh.c8
-rw-r--r--ext/pdo/pdo_stmt.c2
-rwxr-xr-xext/standard/basic_functions.c2
-rw-r--r--ext/standard/math.c4
-rw-r--r--ext/standard/proc_open.c6
-rw-r--r--ext/standard/streamsfuncs.c4
8 files changed, 20 insertions, 14 deletions
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index 0b9fcd76af..cb97f5e94d 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -1226,6 +1226,9 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(int num, char *e
#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); \
@@ -1463,6 +1466,9 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(int num, char *e
#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); \
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index dfad240fb1..6e878063eb 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -4444,7 +4444,7 @@ PHP_FUNCTION(timezone_identifiers_list)
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 */
diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c
index 873aa2d681..b3d4f24363 100644
--- a/ext/pdo/pdo_dbh.c
+++ b/ext/pdo/pdo_dbh.c
@@ -210,9 +210,9 @@ static PHP_METHOD(PDO, dbh_constructor)
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 */
@@ -938,7 +938,7 @@ static PHP_METHOD(PDO, lastInsertId)
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();
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c
index 4acfcb0003..771c7a4dde 100644
--- a/ext/pdo/pdo_stmt.c
+++ b/ext/pdo/pdo_stmt.c
@@ -423,7 +423,7 @@ static PHP_METHOD(PDOStatement, execute)
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();
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 1c3ad1d2bd..80c1ea9ec3 100755
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -4413,7 +4413,7 @@ PHP_FUNCTION(ini_get_all)
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();
diff --git a/ext/standard/math.c b/ext/standard/math.c
index ef5beeb160..18498a21d2 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -1251,8 +1251,8 @@ PHP_FUNCTION(number_format)
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()) {
diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c
index 12e9820522..166b4b0398 100644
--- a/ext/standard/proc_open.c
+++ b/ext/standard/proc_open.c
@@ -518,9 +518,9 @@ PHP_FUNCTION(proc_open)
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));
diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c
index 7c08083f5b..89d5abd251 100644
--- a/ext/standard/streamsfuncs.c
+++ b/ext/standard/streamsfuncs.c
@@ -1128,8 +1128,8 @@ PHP_FUNCTION(stream_context_create)
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();