diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 88df8f6edb2f5..028779705a736 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -45,6 +45,9 @@ PHP 8.6 INTERNALS UPGRADE NOTES __callStatic zend_function* instead of a CE and a boolean argument. . The zend_set_hash_symbol() API has been removed. . Added zend_hash_str_lookup(). + . The WRONG_PARAM_COUNT and ZEND_WRONG_PARAM_COUNT() macros have been + removed. Call zend_wrong_param_count(); followed by RETURN_THROWS(); + instead. ======================== 2. Build system changes diff --git a/Zend/zend_API.h b/Zend/zend_API.h index e6d5a024cf61b..1bb47a2e8703d 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -523,9 +523,7 @@ ZEND_API const char *zend_get_type_by_const(int type); #define getThis() (hasThis() ? ZEND_THIS : NULL) #define ZEND_IS_METHOD_CALL() (EX(func)->common.scope != NULL) -#define WRONG_PARAM_COUNT ZEND_WRONG_PARAM_COUNT() #define ZEND_NUM_ARGS() EX_NUM_ARGS() -#define ZEND_WRONG_PARAM_COUNT() { zend_wrong_param_count(); return; } #ifndef ZEND_WIN32 #define DLEXPORT diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 366903b2c2ab1..e9acd18990664 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -980,7 +980,8 @@ PHP_FUNCTION(ldap_connect) #ifdef HAVE_ORALDAP if (ZEND_NUM_ARGS() == 3 || ZEND_NUM_ARGS() == 4) { - WRONG_PARAM_COUNT; + zend_wrong_param_count(); + RETURN_THROWS(); } if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!lssl", &host, &hostlen, &port, &wallet, &walletlen, &walletpasswd, &walletpasswdlen, &authmode) != SUCCESS) { diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index c67a6ec4b2824..5ef7540f822d1 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -2501,7 +2501,8 @@ PHP_METHOD(SplFileObject, fscanf) int result = php_sscanf_internal(ZSTR_VAL(intern->u.file.current_line), ZSTR_VAL(format_str), (int)num_varargs, varargs, 0, return_value); if (SCAN_ERROR_WRONG_PARAM_COUNT == result) { - WRONG_PARAM_COUNT; + zend_wrong_param_count(); + RETURN_THROWS(); } } /* }}} */ diff --git a/ext/standard/file.c b/ext/standard/file.c index ab6ed4fbadd2d..fdeabd1872d20 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -961,7 +961,8 @@ PHP_FUNCTION(fscanf) efree(buf); if (SCAN_ERROR_WRONG_PARAM_COUNT == result) { - WRONG_PARAM_COUNT; + zend_wrong_param_count(); + RETURN_THROWS(); } } /* }}} */ diff --git a/ext/standard/string.c b/ext/standard/string.c index ddf4221bf6edb..029c7a29bb478 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -5873,7 +5873,8 @@ PHP_FUNCTION(sscanf) result = php_sscanf_internal(str, format, num_args, args, 0, return_value); if (SCAN_ERROR_WRONG_PARAM_COUNT == result) { - WRONG_PARAM_COUNT; + zend_wrong_param_count(); + RETURN_THROWS(); } } /* }}} */