Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions UPGRADING.INTERNALS
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ PHP 8.6 INTERNALS UPGRADE NOTES
. The misnamed ZVAL_IS_NULL() has been removed. Use Z_ISNULL() instead.
. New zend_class_entry.ce_flags2 and zend_function.fn_flags2 fields were
added, given the primary flags were running out of bits.
. 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
Expand Down
2 changes: 0 additions & 2 deletions Zend/zend_API.h
Original file line number Diff line number Diff line change
Expand Up @@ -527,9 +527,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
Expand Down
3 changes: 2 additions & 1 deletion ext/gd/gd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3624,7 +3624,8 @@ PHP_FUNCTION(imagefilter)
};

if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > IMAGE_FILTER_MAX_ARGS) {
WRONG_PARAM_COUNT;
zend_wrong_param_count();
RETURN_THROWS();
} else if (zend_parse_parameters(2, "Ol", &tmp, gd_image_ce, &filtertype) == FAILURE) {
RETURN_THROWS();
}
Expand Down
3 changes: 2 additions & 1 deletion ext/ldap/ldap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
10 changes: 7 additions & 3 deletions ext/pgsql/pgsql.c
Original file line number Diff line number Diff line change
Expand Up @@ -2113,8 +2113,11 @@ PHP_FUNCTION(pg_fetch_assoc)
{
/* pg_fetch_assoc() is added from PHP 4.3.0. It should raise error, when
there is 3rd parameter */
if (ZEND_NUM_ARGS() > 2)
WRONG_PARAM_COUNT;
if (ZEND_NUM_ARGS() > 2) {
zend_wrong_param_count();
RETURN_THROWS();
}

php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, PGSQL_ASSOC, 0);
}
/* }}} */
Expand Down Expand Up @@ -2876,7 +2879,8 @@ PHP_FUNCTION(pg_lo_import)
CHECK_DEFAULT_LINK(link);
}
else {
WRONG_PARAM_COUNT;
zend_wrong_param_count();
RETURN_THROWS();
}

if (php_check_open_basedir(ZSTR_VAL(file_in))) {
Expand Down
6 changes: 4 additions & 2 deletions ext/sockets/sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -1580,7 +1580,8 @@ PHP_FUNCTION(socket_recvfrom)

if (arg6 == NULL) {
zend_string_efree(recv_buf);
WRONG_PARAM_COUNT;
zend_wrong_param_count();
RETURN_THROWS();
}

retval = recvfrom(php_sock->bsd_socket, ZSTR_VAL(recv_buf), arg3, arg4, (struct sockaddr *)&sin, (socklen_t *)&slen);
Expand All @@ -1607,7 +1608,8 @@ PHP_FUNCTION(socket_recvfrom)

if (arg6 == NULL) {
zend_string_efree(recv_buf);
WRONG_PARAM_COUNT;
zend_wrong_param_count();
RETURN_THROWS();
}

retval = recvfrom(php_sock->bsd_socket, ZSTR_VAL(recv_buf), arg3, arg4, (struct sockaddr *)&sin6, (socklen_t *)&slen);
Expand Down
3 changes: 2 additions & 1 deletion ext/spl/spl_directory.c
Original file line number Diff line number Diff line change
Expand Up @@ -2583,7 +2583,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();
}
}
/* }}} */
Expand Down
3 changes: 2 additions & 1 deletion ext/standard/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
/* }}} */
Expand Down
3 changes: 2 additions & 1 deletion ext/standard/string.c
Original file line number Diff line number Diff line change
Expand Up @@ -5875,7 +5875,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();
}
}
/* }}} */
Expand Down