mysqli: Deprecate mysqli_execute() (#19286)

RFC: https://wiki.php.net/rfc/deprecations_php_8_5#formally_deprecate_mysqli_execute
This commit is contained in:
Tim Düsterhus 2025-08-08 22:23:31 +02:00 committed by GitHub
parent 3bf21a0d43
commit 5d86515772
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View file

@ -1383,6 +1383,7 @@ function mysqli_error_list(mysqli $mysql): array {}
function mysqli_stmt_execute(mysqli_stmt $statement, ?array $params = null): bool {}
/** @alias mysqli_stmt_execute */
#[\Deprecated(since: '8.5', message: "use mysqli_stmt_execute() instead")]
function mysqli_execute(mysqli_stmt $statement, ?array $params = null): bool {}
function mysqli_execute_query(mysqli $mysql, string $query, ?array $params = null): mysqli_result|bool {}

View file

@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 2547f63fd024fd5f4fecc574bbcff1301d1d36e5 */
* Stub hash: ce02f0eeb9191e7c92cb8a5e5fcae20fceb0b47c */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_affected_rows, 0, 1, MAY_BE_LONG|MAY_BE_STRING)
ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0)
@ -837,7 +837,7 @@ static const zend_function_entry ext_functions[] = {
ZEND_FE(mysqli_error, arginfo_mysqli_error)
ZEND_FE(mysqli_error_list, arginfo_mysqli_error_list)
ZEND_FE(mysqli_stmt_execute, arginfo_mysqli_stmt_execute)
ZEND_RAW_FENTRY("mysqli_execute", zif_mysqli_stmt_execute, arginfo_mysqli_execute, 0, NULL, NULL)
ZEND_RAW_FENTRY("mysqli_execute", zif_mysqli_stmt_execute, arginfo_mysqli_execute, ZEND_ACC_DEPRECATED, NULL, NULL)
ZEND_FE(mysqli_execute_query, arginfo_mysqli_execute_query)
ZEND_FE(mysqli_fetch_field, arginfo_mysqli_fetch_field)
ZEND_FE(mysqli_fetch_fields, arginfo_mysqli_fetch_fields)
@ -1150,6 +1150,13 @@ static void register_mysqli_symbols(int module_number)
zend_add_parameter_attribute(zend_hash_str_find_ptr(CG(function_table), "mysqli_connect", sizeof("mysqli_connect") - 1), 2, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0);
zend_attribute *attribute_Deprecated_func_mysqli_execute_0 = zend_add_function_attribute(zend_hash_str_find_ptr(CG(function_table), "mysqli_execute", sizeof("mysqli_execute") - 1), ZSTR_KNOWN(ZEND_STR_DEPRECATED_CAPITALIZED), 2);
ZVAL_STR(&attribute_Deprecated_func_mysqli_execute_0->args[0].value, ZSTR_KNOWN(ZEND_STR_8_DOT_5));
attribute_Deprecated_func_mysqli_execute_0->args[0].name = ZSTR_KNOWN(ZEND_STR_SINCE);
zend_string *attribute_Deprecated_func_mysqli_execute_0_arg1_str = zend_string_init("use mysqli_stmt_execute() instead", strlen("use mysqli_stmt_execute() instead"), 1);
ZVAL_STR(&attribute_Deprecated_func_mysqli_execute_0->args[1].value, attribute_Deprecated_func_mysqli_execute_0_arg1_str);
attribute_Deprecated_func_mysqli_execute_0->args[1].name = ZSTR_KNOWN(ZEND_STR_MESSAGE);
zend_attribute *attribute_Deprecated_func_mysqli_kill_0 = zend_add_function_attribute(zend_hash_str_find_ptr(CG(function_table), "mysqli_kill", sizeof("mysqli_kill") - 1), ZSTR_KNOWN(ZEND_STR_DEPRECATED_CAPITALIZED), 2);
ZVAL_STR(&attribute_Deprecated_func_mysqli_kill_0->args[0].value, ZSTR_KNOWN(ZEND_STR_8_DOT_4));
attribute_Deprecated_func_mysqli_kill_0->args[0].name = ZSTR_KNOWN(ZEND_STR_SINCE);