Commit 11a95749b1c for php.net
commit 11a95749b1c10ef9ef2ff19a2f27739673ca9883
Author: Alexandre Daubois <2144837+alexandre-daubois@users.noreply.github.com>
Date: Wed Mar 4 14:07:46 2026 +0100
Convert more zend_parse_parameters_none() to fast ZPP (#21330)
diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c
index 129db275a72..1b8c8a082a0 100644
--- a/ext/com_dotnet/com_com.c
+++ b/ext/com_dotnet/com_com.c
@@ -658,9 +658,7 @@ PHP_FUNCTION(com_create_guid)
GUID retval;
OLECHAR *guid_string;
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
php_com_initialize();
if (CoCreateGuid(&retval) == S_OK && StringFromCLSID(&retval, &guid_string) == S_OK) {
diff --git a/ext/com_dotnet/com_persist.c b/ext/com_dotnet/com_persist.c
index 742e007a2fb..1b89aea15e2 100644
--- a/ext/com_dotnet/com_persist.c
+++ b/ext/com_dotnet/com_persist.c
@@ -319,9 +319,7 @@ CPH_METHOD(GetCurFileName)
OLECHAR *olename = NULL;
CPH_FETCH();
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
CPH_NO_OBJ();
@@ -457,9 +455,7 @@ CPH_METHOD(GetMaxStreamSize)
ULARGE_INTEGER size;
CPH_FETCH();
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
CPH_NO_OBJ();
@@ -491,9 +487,7 @@ CPH_METHOD(InitNew)
HRESULT res;
CPH_FETCH();
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
CPH_NO_OBJ();
diff --git a/ext/dba/dba.c b/ext/dba/dba.c
index 89632303532..fb6017fbab8 100644
--- a/ext/dba/dba.c
+++ b/ext/dba/dba.c
@@ -1301,9 +1301,7 @@ PHP_FUNCTION(dba_handlers)
/* {{{ List opened databases */
PHP_FUNCTION(dba_list)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
array_init(return_value);
diff --git a/ext/dom/document.c b/ext/dom/document.c
index b46722d854c..9d7213a64df 100644
--- a/ext/dom/document.c
+++ b/ext/dom/document.c
@@ -502,9 +502,7 @@ PHP_METHOD(DOMDocument, createDocumentFragment)
dom_object *intern;
id = ZEND_THIS;
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
@@ -1251,9 +1249,7 @@ PHP_METHOD(DOMDocument, normalizeDocument)
dom_object *intern;
id = ZEND_THIS;
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
@@ -1818,9 +1814,7 @@ PHP_METHOD(DOMDocument, validate)
xmlValidCtxt *cvp;
id = ZEND_THIS;
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
diff --git a/ext/dom/documentfragment.c b/ext/dom/documentfragment.c
index 76870faedfa..65538b711f2 100644
--- a/ext/dom/documentfragment.c
+++ b/ext/dom/documentfragment.c
@@ -36,9 +36,7 @@ PHP_METHOD(DOMDocumentFragment, __construct)
xmlNodePtr nodep = NULL, oldnode = NULL;
dom_object *intern;
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
nodep = xmlNewDocFragment(NULL);
diff --git a/ext/dom/element.c b/ext/dom/element.c
index 9d70390275c..4d0099b2c64 100644
--- a/ext/dom/element.c
+++ b/ext/dom/element.c
@@ -1477,9 +1477,7 @@ PHP_METHOD(DOMElement, remove)
{
dom_object *intern;
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
DOM_GET_THIS_INTERN(intern);
diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c
index 534908f9d1c..43547ab9b5d 100644
--- a/ext/enchant/enchant.c
+++ b/ext/enchant/enchant.c
@@ -264,9 +264,7 @@ PHP_FUNCTION(enchant_broker_init)
enchant_broker *broker;
EnchantBroker *pbroker;
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
pbroker = enchant_broker_init();
if (pbroker) {
diff --git a/ext/filter/filter.c b/ext/filter/filter.c
index 70ab5d358f2..03f0f7887f9 100644
--- a/ext/filter/filter.c
+++ b/ext/filter/filter.c
@@ -825,9 +825,7 @@ PHP_FUNCTION(filter_list)
{
int size = sizeof(filter_list) / sizeof(filter_list_entry);
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
array_init(return_value);
for (int i = 0; i < size; ++i) {
diff --git a/ext/hash/hash.c b/ext/hash/hash.c
index d255711efbe..8a9494fb62d 100644
--- a/ext/hash/hash.c
+++ b/ext/hash/hash.c
@@ -858,9 +858,7 @@ PHP_FUNCTION(hash_algos)
{
zend_string *str;
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
array_init(return_value);
ZEND_HASH_MAP_FOREACH_STR_KEY(&php_hash_hashtable, str) {
@@ -875,9 +873,7 @@ PHP_FUNCTION(hash_hmac_algos)
zend_string *str;
const php_hash_ops *ops;
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
array_init(return_value);
ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(&php_hash_hashtable, str, ops) {
@@ -1260,9 +1256,7 @@ PHP_FUNCTION(mhash_get_hash_name)
/* {{{ Gets the number of available hashes */
PHP_FUNCTION(mhash_count)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
RETURN_LONG(MHASH_NUM_ALGOS - 1);
}
/* }}} */
@@ -1463,9 +1457,7 @@ PHP_METHOD(HashContext, __serialize)
zend_long magic = 0;
zval tmp;
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
array_init(return_value);
diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c
index 5831ce2a5a6..a819def4b5b 100644
--- a/ext/mbstring/php_mbregex.c
+++ b/ext/mbstring/php_mbregex.c
@@ -1506,9 +1506,7 @@ PHP_FUNCTION(mb_ereg_search_getregs)
int beg, end;
OnigUChar *str;
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
if (MBREX(search_regs) != NULL && Z_TYPE(MBREX(search_str)) == IS_STRING) {
array_init(return_value);
@@ -1544,9 +1542,7 @@ PHP_FUNCTION(mb_ereg_search_getregs)
/* {{{ Get search start position */
PHP_FUNCTION(mb_ereg_search_getpos)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
RETVAL_LONG(MBREX(search_pos));
}
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index b171986d29c..caefd9432d1 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -723,9 +723,7 @@ PHP_METHOD(mysqli_result, __construct)
PHP_METHOD(mysqli_result, getIterator)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
zend_create_internal_iterator_zval(return_value, ZEND_THIS);
}
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index 7af90f66585..9473f4a06c1 100644
--- a/ext/mysqli/mysqli_api.c
+++ b/ext/mysqli/mysqli_api.c
@@ -856,9 +856,7 @@ PHP_FUNCTION(mysqli_free_result)
PHP_FUNCTION(mysqli_get_client_info)
{
if (hasThis()) {
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
} else {
zval *mysql_link;
@@ -878,9 +876,7 @@ PHP_FUNCTION(mysqli_get_client_info)
/* {{{ Get MySQL client info */
PHP_FUNCTION(mysqli_get_client_version)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
RETURN_LONG((zend_long)mysql_get_client_version());
}
@@ -1946,9 +1942,7 @@ PHP_FUNCTION(mysqli_thread_id)
/* {{{ Return whether thread safety is given or not */
PHP_FUNCTION(mysqli_thread_safe)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
RETURN_BOOL(mysql_thread_safe());
}
diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c
index a3208b41574..50c9b36e4ce 100644
--- a/ext/mysqli/mysqli_nonapi.c
+++ b/ext/mysqli/mysqli_nonapi.c
@@ -343,9 +343,7 @@ PHP_METHOD(mysqli, init)
/* {{{ Returns the numerical value of the error message from last connect command */
PHP_FUNCTION(mysqli_connect_errno)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
RETURN_LONG(MyG(error_no));
}
@@ -354,9 +352,7 @@ PHP_FUNCTION(mysqli_connect_errno)
/* {{{ Returns the text of the error message from previous MySQL operation */
PHP_FUNCTION(mysqli_connect_error)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
if (MyG(error_msg)) {
RETURN_STRING(MyG(error_msg));
@@ -448,9 +444,7 @@ PHP_FUNCTION(mysqli_fetch_all)
/* {{{ Returns statistics about the zval cache */
PHP_FUNCTION(mysqli_get_client_stats)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
mysqlnd_get_client_stats(return_value);
}
/* }}} */
@@ -1088,9 +1082,7 @@ PHP_FUNCTION(mysqli_release_savepoint)
/* {{{ Returns information about open and cached links */
PHP_FUNCTION(mysqli_get_links_stats)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
array_init(return_value);
add_assoc_long_ex(return_value, "total", sizeof("total") - 1, MyG(num_links));
diff --git a/ext/mysqli/mysqli_warning.c b/ext/mysqli/mysqli_warning.c
index 4b0792b9684..0bb730ef6cf 100644
--- a/ext/mysqli/mysqli_warning.c
+++ b/ext/mysqli/mysqli_warning.c
@@ -120,9 +120,7 @@ PHP_METHOD(mysqli_warning, next)
MYSQLI_WARNING *w;
mysqli_object *obj = Z_MYSQLI_P(ZEND_THIS);
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
if (obj->ptr) {
MYSQLI_FETCH_RESOURCE(w, MYSQLI_WARNING *, ZEND_THIS, MYSQLI_STATUS_VALID);
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index a6af7469cba..7eec40aa656 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -823,9 +823,7 @@ PHP_FUNCTION(odbc_close_all)
{
zval *zv;
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
/* Loop through the link list, now close all links and their results */
ZEND_HASH_FOREACH_VAL(&ODBCG(connections), zv) {
diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c
index befbb621f4c..1eaa183f9df 100644
--- a/ext/opcache/zend_accelerator_module.c
+++ b/ext/opcache/zend_accelerator_module.c
@@ -801,9 +801,7 @@ ZEND_FUNCTION(opcache_get_configuration)
{
zval directives, version, blacklist;
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
if (!validate_api_restriction()) {
RETURN_FALSE;
@@ -908,9 +906,7 @@ ZEND_FUNCTION(opcache_get_configuration)
/* {{{ Request that the contents of the opcode cache to be reset */
ZEND_FUNCTION(opcache_reset)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
if (!validate_api_restriction()) {
RETURN_FALSE;
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 9e39e2ad3e7..1ec9ec85729 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -522,9 +522,7 @@ PHP_MSHUTDOWN_FUNCTION(openssl)
/* {{{ Retrieve an array mapping available certificate locations */
PHP_FUNCTION(openssl_get_cert_locations)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
array_init(return_value);
php_openssl_set_cert_locations(return_value);
@@ -4024,9 +4022,7 @@ PHP_FUNCTION(openssl_error_string)
char buf[256];
unsigned long val;
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
php_openssl_store_errors();
@@ -4444,9 +4440,7 @@ PHP_FUNCTION(openssl_get_curve_names)
size_t i;
size_t len = EC_get_builtin_curves(NULL, 0);
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
curves = emalloc(sizeof(EC_builtin_curve) * len);
if (!EC_get_builtin_curves(curves, len)) {
diff --git a/ext/pdo_firebird/pdo_firebird.c b/ext/pdo_firebird/pdo_firebird.c
index abc43dd3ad5..ece55926b0f 100644
--- a/ext/pdo_firebird/pdo_firebird.c
+++ b/ext/pdo_firebird/pdo_firebird.c
@@ -106,9 +106,7 @@ PHP_MINFO_FUNCTION(pdo_firebird) /* {{{ */
PHP_METHOD(Pdo_Firebird, getApiVersion)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
RETURN_LONG(FB_API_VER);
}
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index dad6a726f1b..b9671ac1caa 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -309,9 +309,7 @@ PHP_FUNCTION(readline_add_history)
/* {{{ Clears the history */
PHP_FUNCTION(readline_clear_history)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
#ifdef HAVE_LIBEDIT
/* clear_history is the only function where rl_initialize
@@ -331,9 +329,7 @@ PHP_FUNCTION(readline_list_history)
{
HIST_ENTRY **history;
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
array_init(return_value);
@@ -546,9 +542,7 @@ PHP_FUNCTION(readline_callback_handler_install)
/* {{{ Informs the readline callback interface that a character is ready for input */
PHP_FUNCTION(readline_callback_read_char)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
if (Z_TYPE(_prepped_callback) != IS_UNDEF) {
rl_callback_read_char();
@@ -559,9 +553,7 @@ PHP_FUNCTION(readline_callback_read_char)
/* {{{ Removes a previously installed callback handler and restores terminal settings */
PHP_FUNCTION(readline_callback_handler_remove)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
if (Z_TYPE(_prepped_callback) != IS_UNDEF) {
rl_callback_handler_remove();
@@ -576,9 +568,7 @@ PHP_FUNCTION(readline_callback_handler_remove)
/* {{{ Ask readline to redraw the display */
PHP_FUNCTION(readline_redisplay)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
#ifdef HAVE_LIBEDIT
/* seems libedit doesn't take care of rl_initialize in rl_redisplay
@@ -595,9 +585,7 @@ PHP_FUNCTION(readline_redisplay)
/* {{{ Inform readline that the cursor has moved to a new line */
PHP_FUNCTION(readline_on_new_line)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
rl_on_new_line();
}
diff --git a/ext/session/mod_user_class.c b/ext/session/mod_user_class.c
index 618cc6bd679..eb5a47b19ce 100644
--- a/ext/session/mod_user_class.c
+++ b/ext/session/mod_user_class.c
@@ -146,9 +146,7 @@ PHP_METHOD(SessionHandler, create_sid)
{
zend_string *id;
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
PS_SANITY_CHECK;
diff --git a/ext/session/session.c b/ext/session/session.c
index 02977d8d611..e790fa074d6 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -1923,9 +1923,7 @@ PHP_FUNCTION(session_set_cookie_params)
PHP_FUNCTION(session_get_cookie_params)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
array_init(return_value);
@@ -2509,9 +2507,7 @@ PHP_FUNCTION(session_encode)
{
zend_string *enc;
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
enc = php_session_encode();
if (enc == NULL) {
@@ -2638,18 +2634,14 @@ PHP_FUNCTION(session_start)
PHP_FUNCTION(session_destroy)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
RETURN_BOOL(php_session_destroy() == SUCCESS);
}
PHP_FUNCTION(session_unset)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
if (PS(session_status) != php_session_active) {
RETURN_FALSE;
@@ -2669,9 +2661,7 @@ PHP_FUNCTION(session_gc)
{
zend_long num;
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
if (PS(session_status) != php_session_active) {
php_error_docref(NULL, E_WARNING, "Session cannot be garbage collected when there is no active session");
@@ -2689,9 +2679,7 @@ PHP_FUNCTION(session_gc)
PHP_FUNCTION(session_write_close)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
RETURN_BOOL(php_session_flush(true));
}
@@ -2699,9 +2687,7 @@ PHP_FUNCTION(session_write_close)
/* Abort session and end session. Session data will not be written */
PHP_FUNCTION(session_abort)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
RETURN_BOOL(php_session_abort());
}
@@ -2709,18 +2695,14 @@ PHP_FUNCTION(session_abort)
/* Reset session data from saved session data */
PHP_FUNCTION(session_reset)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
RETURN_BOOL(php_session_reset());
}
PHP_FUNCTION(session_status)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
RETURN_LONG(PS(session_status));
}
diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c
index 3d41b2c2c22..659de2291d8 100644
--- a/ext/sqlite3/sqlite3.c
+++ b/ext/sqlite3/sqlite3.c
@@ -186,9 +186,7 @@ PHP_METHOD(SQLite3, close)
int errcode;
db_obj = Z_SQLITE3_DB_P(object);
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
if (db_obj->initialised) {
zend_llist_clean(&(db_obj->free_list));
@@ -237,9 +235,7 @@ PHP_METHOD(SQLite3, exec)
/* {{{ Returns the SQLite3 Library version as a string constant and as a number. */
PHP_METHOD(SQLite3, version)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
array_init(return_value);
@@ -257,9 +253,7 @@ PHP_METHOD(SQLite3, lastInsertRowID)
zval *object = ZEND_THIS;
db_obj = Z_SQLITE3_DB_P(object);
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
@@ -274,9 +268,7 @@ PHP_METHOD(SQLite3, lastErrorCode)
zval *object = ZEND_THIS;
db_obj = Z_SQLITE3_DB_P(object);
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->db, SQLite3)
@@ -295,9 +287,7 @@ PHP_METHOD(SQLite3, lastExtendedErrorCode)
zval *object = ZEND_THIS;
db_obj = Z_SQLITE3_DB_P(object);
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->db, SQLite3)
@@ -343,9 +333,7 @@ PHP_METHOD(SQLite3, lastErrorMsg)
zval *object = ZEND_THIS;
db_obj = Z_SQLITE3_DB_P(object);
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->db, SQLite3)
@@ -469,9 +457,7 @@ PHP_METHOD(SQLite3, changes)
zval *object = ZEND_THIS;
db_obj = Z_SQLITE3_DB_P(object);
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3)
diff --git a/ext/standard/http.c b/ext/standard/http.c
index 47443f74ffe..9ce8d5e559a 100644
--- a/ext/standard/http.c
+++ b/ext/standard/http.c
@@ -374,9 +374,7 @@ PHP_FUNCTION(request_parse_body)
PHP_FUNCTION(http_get_last_response_headers)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
if (!Z_ISUNDEF(BG(last_http_headers))) {
RETURN_COPY(&BG(last_http_headers));
@@ -387,9 +385,7 @@ PHP_FUNCTION(http_get_last_response_headers)
PHP_FUNCTION(http_clear_last_response_headers)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
zval_ptr_dtor(&BG(last_http_headers));
ZVAL_UNDEF(&BG(last_http_headers));
diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c
index 6d711e89b89..0c65305c682 100644
--- a/ext/xmlwriter/php_xmlwriter.c
+++ b/ext/xmlwriter/php_xmlwriter.c
@@ -907,9 +907,7 @@ PHP_FUNCTION(xmlwriter_open_memory)
zval *self = getThis();
ze_xmlwriter_object *ze_obj = NULL;
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
if (self) {
/* We do not use XMLWRITER_FROM_OBJECT, xmlwriter init function here */
diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c
index 7e184421aee..18b1edaf37a 100644
--- a/ext/xsl/xsltprocessor.c
+++ b/ext/xsl/xsltprocessor.c
@@ -814,9 +814,7 @@ PHP_METHOD(XSLTProcessor, getSecurityPrefs)
zval *id = ZEND_THIS;
xsl_object *intern;
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
intern = Z_XSL_P(id);
@@ -827,9 +825,7 @@ PHP_METHOD(XSLTProcessor, getSecurityPrefs)
/* {{{ */
PHP_METHOD(XSLTProcessor, hasExsltSupport)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
#ifdef HAVE_XSL_EXSLT
RETURN_TRUE;
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 4a6bb81899c..d5a89768ff6 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -588,9 +588,7 @@ PHP_FUNCTION(ob_gzhandler)
/* {{{ Returns the coding type used for output compression */
PHP_FUNCTION(zlib_get_coding_type)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
switch (ZLIBG(compression_coding)) {
case PHP_ZLIB_ENCODING_GZIP:
RETURN_STRINGL("gzip", sizeof("gzip") - 1);
diff --git a/sapi/apache2handler/php_functions.c b/sapi/apache2handler/php_functions.c
index 9b073207c81..c2b15af86a6 100644
--- a/sapi/apache2handler/php_functions.c
+++ b/sapi/apache2handler/php_functions.c
@@ -172,9 +172,7 @@ PHP_FUNCTION(apache_request_headers)
const apr_array_header_t *arr;
char *key, *val;
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
array_init(return_value);
@@ -195,9 +193,7 @@ PHP_FUNCTION(apache_response_headers)
const apr_array_header_t *arr;
char *key, *val;
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
array_init(return_value);
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 3decc673389..213870db54f 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -1687,9 +1687,7 @@ static void add_response_header(sapi_header_struct *h, zval *return_value) /* {{
PHP_FUNCTION(apache_response_headers) /* {{{ */
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
array_init(return_value);
zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t)add_response_header, return_value);
diff --git a/sapi/cli/php_cli_process_title.c b/sapi/cli/php_cli_process_title.c
index a786de2b465..fe36c9a2fdb 100644
--- a/sapi/cli/php_cli_process_title.c
+++ b/sapi/cli/php_cli_process_title.c
@@ -48,9 +48,7 @@ PHP_FUNCTION(cli_get_process_title)
size_t length = 0;
const char* title = NULL;
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
ps_title_status rc = get_ps_title(&length, &title);
if (rc != PS_TITLE_SUCCESS) {
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
index bab7ad011e0..65d6d5a898d 100644
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -401,9 +401,7 @@ PHP_FUNCTION(apache_request_headers) /* {{{ */
{
php_cli_server_client *client;
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
client = SG(server_context);
@@ -442,9 +440,7 @@ static void add_response_header(sapi_header_struct *h, zval *return_value) /* {{
PHP_FUNCTION(apache_response_headers) /* {{{ */
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
array_init(return_value);
zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t)add_response_header, return_value);
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index f1f7de70b27..83b00eb4c4d 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -1492,9 +1492,7 @@ PHP_FUNCTION(fastcgi_finish_request) /* {{{ */
{
fcgi_request *request = (fcgi_request*) SG(server_context);
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
if (!fcgi_is_closed(request)) {
php_output_end_all();
@@ -1514,9 +1512,7 @@ PHP_FUNCTION(apache_request_headers) /* {{{ */
{
fcgi_request *request;
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
array_init(return_value);
if ((request = (fcgi_request*) SG(server_context))) {
@@ -1527,9 +1523,7 @@ PHP_FUNCTION(apache_request_headers) /* {{{ */
/* {{{ Returns the status of the fastcgi process manager */
PHP_FUNCTION(fpm_get_status) /* {{{ */
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
if (fpm_status_export_to_zval(return_value)) {
RETURN_FALSE;
diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c
index 75dc721240e..dea92b8b83c 100644
--- a/sapi/litespeed/lsapi_main.c
+++ b/sapi/litespeed/lsapi_main.c
@@ -1658,9 +1658,7 @@ static int add_associate_array( const char * pKey, int keyLen, const char * pVal
/* {{{ Fetch all HTTP request headers */
PHP_FUNCTION(litespeed_request_headers)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
array_init(return_value);
@@ -1679,9 +1677,7 @@ PHP_FUNCTION(litespeed_response_headers)
int len;
char headerBuf[SAPI_LSAPI_MAX_HEADER_LENGTH];
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
if (!zend_llist_count(&SG(sapi_headers).headers)) {
RETURN_FALSE;
@@ -1721,9 +1717,7 @@ PHP_FUNCTION(apache_get_modules)
};
const char **name = mod_names;
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
array_init(return_value);
while( *name )
@@ -1738,9 +1732,7 @@ PHP_FUNCTION(apache_get_modules)
/* {{{ Flushes all response data to the client */
PHP_FUNCTION(litespeed_finish_request)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
php_output_end_all();
php_header();
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index 4ef83be1b9f..4227acae4f1 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -288,9 +288,7 @@ PHP_FUNCTION(phpdbg_break_next)
{
zend_execute_data *ex;
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
ex = EG(current_execute_data);
while (ex && ex->func && !ZEND_USER_CODE(ex->func->type)) {
@@ -347,9 +345,7 @@ PHP_FUNCTION(phpdbg_break_function)
/* {{{ instructs phpdbg to clear breakpoints */
PHP_FUNCTION(phpdbg_clear)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
zend_hash_clean(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE]);
zend_hash_clean(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE_PENDING]);
@@ -404,9 +400,7 @@ PHP_FUNCTION(phpdbg_start_oplog)
{
phpdbg_oplog_list *prev;
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
prev = PHPDBG_G(oplog_list);
diff --git a/win32/codepage.c b/win32/codepage.c
index e038a9fbd41..b8c2301fb70 100644
--- a/win32/codepage.c
+++ b/win32/codepage.c
@@ -646,9 +646,7 @@ PHP_FUNCTION(sapi_windows_cp_get)
/* {{{ Indicates whether the codepage is UTF-8 compatible. */
PHP_FUNCTION(sapi_windows_cp_is_utf8)
{
- if (zend_parse_parameters_none() == FAILURE) {
- RETURN_THROWS();
- }
+ ZEND_PARSE_PARAMETERS_NONE();
RETURN_BOOL(php_win32_cp_use_unicode());
}