Skip to content

Commit 8ca6548

Browse files
committed
Make $params non-nullable
1 parent 6960567 commit 8ca6548

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

ext/mysqli/mysqli.stub.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ public function data_seek(int $offset) {}
507507
* @return bool
508508
* @alias mysqli_stmt_execute
509509
*/
510-
public function execute(?array $params = null) {}
510+
public function execute(array $params = []) {}
511511

512512
/**
513513
* @return bool|null
@@ -644,10 +644,10 @@ function mysqli_error(mysqli $mysql): string {}
644644

645645
function mysqli_error_list(mysqli $mysql): array {}
646646

647-
function mysqli_stmt_execute(mysqli_stmt $statement, ?array $params = null): bool {}
647+
function mysqli_stmt_execute(mysqli_stmt $statement, array $params = []): bool {}
648648

649649
/** @alias mysqli_stmt_execute */
650-
function mysqli_execute(mysqli_stmt $statement, ?array $params = null): bool {}
650+
function mysqli_execute(mysqli_stmt $statement, array $params = []): bool {}
651651

652652
function mysqli_fetch_field(mysqli_result $result): object|false {}
653653

ext/mysqli/mysqli_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ PHP_FUNCTION(mysqli_stmt_execute)
816816
unsigned int i;
817817
#endif
818818

819-
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|h!", &mysql_stmt, mysqli_stmt_class_entry, &input_params) == FAILURE) {
819+
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|h", &mysql_stmt, mysqli_stmt_class_entry, &input_params) == FAILURE) {
820820
RETURN_THROWS();
821821
}
822822
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);

ext/mysqli/mysqli_arginfo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 3f3d19da5a2b7c8edc6dba0fde6215b93d10bb32 */
2+
* Stub hash: 35c309740ea0ee7328ec5dfdbbad057097ca24e7 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_affected_rows, 0, 1, MAY_BE_LONG|MAY_BE_STRING)
55
ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0)
@@ -71,7 +71,7 @@ ZEND_END_ARG_INFO()
7171

7272
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_execute, 0, 1, _IS_BOOL, 0)
7373
ZEND_ARG_OBJ_INFO(0, statement, mysqli_stmt, 0)
74-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, params, IS_ARRAY, 1, "null")
74+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, params, IS_ARRAY, 0, "[]")
7575
ZEND_END_ARG_INFO()
7676

7777
#define arginfo_mysqli_execute arginfo_mysqli_stmt_execute
@@ -644,7 +644,7 @@ ZEND_END_ARG_INFO()
644644
#define arginfo_class_mysqli_stmt_data_seek arginfo_class_mysqli_result_data_seek
645645

646646
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_stmt_execute, 0, 0, 0)
647-
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, params, IS_ARRAY, 1, "null")
647+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, params, IS_ARRAY, 0, "[]")
648648
ZEND_END_ARG_INFO()
649649

650650
#define arginfo_class_mysqli_stmt_fetch arginfo_class_mysqli_character_set_name

ext/mysqli/tests/mysqli_stmt_execute_bind.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ if (!stristr(mysqli_get_client_info(), 'mysqlnd')) {
147147
[002] mysqli_stmt::execute(): Argument #1 ($params) must consist of exactly 3 elements, 4 present
148148
[003] mysqli_stmt::execute(): Argument #1 ($params) must consist of exactly 3 elements, 0 present
149149
[004] No data supplied for parameters in prepared statement
150-
[005] mysqli_stmt::execute(): Argument #1 ($params) must be of type ?array, int given
151-
[006] mysqli_stmt::execute(): Argument #1 ($params) must be of type ?array, stdClass given
150+
[005] mysqli_stmt::execute(): Argument #1 ($params) must be of type array, int given
151+
[006] mysqli_stmt::execute(): Argument #1 ($params) must be of type array, stdClass given
152152
[007] mysqli_stmt::execute(): Argument #1 ($params) must consist of exactly 3 elements, 0 present
153153
[008] mysqli_stmt::execute(): Argument #1 ($params) must be a list array
154154
done!

0 commit comments

Comments
 (0)