summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDharman <tekiela246@gmail.com>2021-01-04 18:08:42 +0000
committerNikita Popov <nikita.ppv@gmail.com>2021-01-06 11:28:45 +0100
commit44a311dbbebce3ffb511c5523a326688f2a9a3ab (patch)
tree777120ac546518cc360e7b1be3d39161a5e40bc0
parent90081c5391552fb9f049ba3b0b1edbe16a510a5e (diff)
downloadphp-git-44a311dbbebce3ffb511c5523a326688f2a9a3ab.tar.gz
Fix/improve mysqli stubs
* mysqli_commit $flags default value is 0, not -1. * A number of functions cannot actually return null. * mysqli_poll parameter names were incorrect, as this function has a different signature from select. * fetch functions apart from fetch_all can return false on failure.
-rw-r--r--ext/mysqli/mysqli.stub.php52
-rw-r--r--ext/mysqli/mysqli_api.c35
-rw-r--r--ext/mysqli/mysqli_arginfo.h53
-rw-r--r--ext/opcache/Optimizer/zend_func_info.c12
4 files changed, 61 insertions, 91 deletions
diff --git a/ext/mysqli/mysqli.stub.php b/ext/mysqli/mysqli.stub.php
index c1059254fc..0e6fe71d61 100644
--- a/ext/mysqli/mysqli.stub.php
+++ b/ext/mysqli/mysqli.stub.php
@@ -36,7 +36,7 @@ class mysqli
public function change_user(string $username, string $password, ?string $database) {}
/**
- * @return string|null
+ * @return string
* @alias mysqli_character_set_name
*/
public function character_set_name() {}
@@ -51,7 +51,7 @@ class mysqli
* @return bool
* @alias mysqli_commit
*/
- public function commit(int $flags = -1, ?string $name = null) {}
+ public function commit(int $flags = 0, ?string $name = null) {}
/**
* @return mysqli|null|false
@@ -101,7 +101,7 @@ class mysqli
#endif
/**
- * @return string|null
+ * @return string
* @alias mysqli_get_server_info
*/
public function get_server_info() {}
@@ -152,7 +152,7 @@ class mysqli
* @return int|false
* @alias mysqli_poll
*/
- public static function poll(?array &$read, ?array &$write, array &$error, int $seconds, int $microseconds = 0) {}
+ public static function poll(?array &$read, ?array &$error, array &$reject, int $seconds, int $microseconds = 0) {}
#endif
/**
@@ -342,7 +342,7 @@ class mysqli_result implements IteratorAggregate
#if defined(MYSQLI_USE_MYSQLND)
/**
- * @return array|false
+ * @return array
* @alias mysqli_fetch_all
*/
public function fetch_all(int $mode = MYSQLI_NUM) {}
@@ -392,7 +392,7 @@ class mysqli_stmt
public function __construct(mysqli $mysql, ?string $query = null) {}
/**
- * @return int|false
+ * @return int
* @alias mysqli_stmt_attr_get
*/
public function attr_get(int $attribute) {}
@@ -529,11 +529,11 @@ function mysqli_begin_transaction(mysqli $mysql, int $flags = 0, ?string $name =
function mysqli_change_user(mysqli $mysql, string $username, string $password, ?string $database): bool {}
-function mysqli_character_set_name(mysqli $mysql): ?string {}
+function mysqli_character_set_name(mysqli $mysql): string {}
function mysqli_close(mysqli $mysql): bool {}
-function mysqli_commit(mysqli $mysql, int $flags = -1, ?string $name = null): bool {}
+function mysqli_commit(mysqli $mysql, int $flags = 0, ?string $name = null): bool {}
function mysqli_connect(
?string $hostname = null,
@@ -556,7 +556,7 @@ function mysqli_debug(string $options): bool {}
function mysqli_errno(mysqli $mysql): int {}
-function mysqli_error(mysqli $mysql): ?string {}
+function mysqli_error(mysqli $mysql): string {}
function mysqli_error_list(mysqli $mysql): array {}
@@ -574,16 +574,16 @@ function mysqli_fetch_field_direct(mysqli_result $result, int $index): object|fa
function mysqli_fetch_lengths(mysqli_result $result): array|false {}
#if defined(MYSQLI_USE_MYSQLND)
-function mysqli_fetch_all(mysqli_result $result, int $mode = MYSQLI_NUM): array|false {}
+function mysqli_fetch_all(mysqli_result $result, int $mode = MYSQLI_NUM): array {}
#endif
function mysqli_fetch_array(mysqli_result $result, int $mode = MYSQLI_BOTH): array|null|false {}
-function mysqli_fetch_assoc(mysqli_result $result): ?array {}
+function mysqli_fetch_assoc(mysqli_result $result): array|null|false {}
-function mysqli_fetch_object(mysqli_result $result, string $class = "stdClass", array $constructor_args = []): ?object {}
+function mysqli_fetch_object(mysqli_result $result, string $class = "stdClass", array $constructor_args = []): object|null|false {}
-function mysqli_fetch_row(mysqli_result $result): ?array {}
+function mysqli_fetch_row(mysqli_result $result): array|null|false {}
function mysqli_field_count(mysqli $mysql): int {}
@@ -638,10 +638,16 @@ function mysqli_num_rows(mysqli_result $result): int|string {}
/** @param string|int $value */
function mysqli_options(mysqli $mysql, int $option, $value): bool {}
+/**
+ * @param string|int $value
+ * @alias mysqli_options
+ */
+function mysqli_set_opt(mysqli $mysql, int $option, $value): bool {}
+
function mysqli_ping(mysqli $mysql): bool {}
#if defined(MYSQLI_USE_MYSQLND)
-function mysqli_poll(?array &$read, ?array &$write, array &$error, int $seconds, int $microseconds = 0): int|false {}
+function mysqli_poll(?array &$read, ?array &$error, array &$reject, int $seconds, int $microseconds = 0): int|false {}
#endif
function mysqli_prepare(mysqli $mysql, string $query): mysqli_stmt|false {}
@@ -663,6 +669,9 @@ function mysqli_real_connect(
function mysqli_real_escape_string(mysqli $mysql, string $string): string {}
+/** @alias mysqli_real_escape_string */
+function mysqli_escape_string(mysqli $mysql, string $string): string {}
+
function mysqli_real_query(mysqli $mysql, string $query): bool {}
#if defined(MYSQLI_USE_MYSQLND)
@@ -695,7 +704,7 @@ function mysqli_stmt_data_seek(mysqli_stmt $statement, int $offset): void {}
function mysqli_stmt_errno(mysqli_stmt $statement): int {}
-function mysqli_stmt_error(mysqli_stmt $statement): ?string {}
+function mysqli_stmt_error(mysqli_stmt $statement): string {}
function mysqli_stmt_error_list(mysqli_stmt $statement): array {}
@@ -735,9 +744,9 @@ function mysqli_stmt_send_long_data(mysqli_stmt $statement, int $param_num, stri
function mysqli_stmt_store_result(mysqli_stmt $statement): bool {}
-function mysqli_stmt_sqlstate(mysqli_stmt $statement): ?string {}
+function mysqli_stmt_sqlstate(mysqli_stmt $statement): string {}
-function mysqli_sqlstate(mysqli $mysql): ?string {}
+function mysqli_sqlstate(mysqli $mysql): string {}
function mysqli_ssl_set(
mysqli $mysql,
@@ -761,12 +770,3 @@ function mysqli_use_result(mysqli $mysql): mysqli_result|false {}
function mysqli_warning_count(mysqli $mysql): int {}
function mysqli_refresh(mysqli $mysql, int $flags): bool {}
-
-/** @alias mysqli_real_escape_string */
-function mysqli_escape_string(mysqli $mysql, string $string): string {}
-
-/**
- * @param string|int $value
- * @alias mysqli_options
- */
-function mysqli_set_opt(mysqli $mysql, int $option, $value): bool {}
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index d1e0634dc7..d402a24817 100644
--- a/ext/mysqli/mysqli_api.c
+++ b/ext/mysqli/mysqli_api.c
@@ -614,17 +614,13 @@ PHP_FUNCTION(mysqli_character_set_name)
{
MY_MYSQL *mysql;
zval *mysql_link;
- const char *cs_name;
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
RETURN_THROWS();
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
- cs_name = mysql_character_set_name(mysql->mysql);
- if (cs_name) {
- RETURN_STRING(cs_name);
- }
+ RETURN_STRING(mysql_character_set_name(mysql->mysql));
}
/* }}} */
@@ -801,16 +797,12 @@ PHP_FUNCTION(mysqli_error)
{
MY_MYSQL *mysql;
zval *mysql_link;
- const char *err;
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
RETURN_THROWS();
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
- err = mysql_error(mysql->mysql);
- if (err) {
- RETURN_STRING(err);
- }
+ RETURN_STRING(mysql_error(mysql->mysql));
}
/* }}} */
@@ -1337,10 +1329,7 @@ PHP_FUNCTION(mysqli_get_client_info)
}
}
- const char * info = mysql_get_client_info();
- if (info) {
- RETURN_STRING(info);
- }
+ RETURN_STRING(mysql_get_client_info());
}
/* }}} */
@@ -2151,16 +2140,12 @@ PHP_FUNCTION(mysqli_sqlstate)
{
MY_MYSQL *mysql;
zval *mysql_link;
- const char *state;
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
RETURN_THROWS();
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
- state = mysql_sqlstate(mysql->mysql);
- if (state) {
- RETURN_STRING(state);
- }
+ RETURN_STRING(mysql_sqlstate(mysql->mysql));
}
/* }}} */
@@ -2360,17 +2345,13 @@ PHP_FUNCTION(mysqli_stmt_error)
{
MY_STMT *stmt;
zval *mysql_stmt;
- const char * err;
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
RETURN_THROWS();
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_INITIALIZED);
- err = mysql_stmt_error(stmt->stmt);
- if (err) {
- RETURN_STRING(err);
- }
+ RETURN_STRING(mysql_stmt_error(stmt->stmt));
}
/* }}} */
@@ -2501,17 +2482,13 @@ PHP_FUNCTION(mysqli_stmt_sqlstate)
{
MY_STMT *stmt;
zval *mysql_stmt;
- const char * state;
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_stmt, mysqli_stmt_class_entry) == FAILURE) {
RETURN_THROWS();
}
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
- state = mysql_stmt_sqlstate(stmt->stmt);
- if (state) {
- RETURN_STRING(state);
- }
+ RETURN_STRING(mysql_stmt_sqlstate(stmt->stmt));
}
/* }}} */
diff --git a/ext/mysqli/mysqli_arginfo.h b/ext/mysqli/mysqli_arginfo.h
index 509840a7fc..fb49d5eac5 100644
--- a/ext/mysqli/mysqli_arginfo.h
+++ b/ext/mysqli/mysqli_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 480939b71e1dacbdbb4634dbabf375943e399b6f */
+ * Stub hash: 0403f612783ee03ff4f586f136b5d3481ecd072c */
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)
@@ -23,7 +23,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_change_user, 0, 4, _IS_BO
ZEND_ARG_TYPE_INFO(0, database, IS_STRING, 1)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_character_set_name, 0, 1, IS_STRING, 1)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_character_set_name, 0, 1, IS_STRING, 0)
ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0)
ZEND_END_ARG_INFO()
@@ -31,11 +31,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_close, 0, 1, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_commit, 0, 1, _IS_BOOL, 0)
- ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0)
- ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "-1")
- ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 1, "null")
-ZEND_END_ARG_INFO()
+#define arginfo_mysqli_commit arginfo_mysqli_begin_transaction
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_mysqli_connect, 0, 0, mysqli, MAY_BE_NULL|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, hostname, IS_STRING, 1, "null")
@@ -97,7 +93,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_fetch_lengths, 0, 1, MAY_
ZEND_END_ARG_INFO()
#if defined(MYSQLI_USE_MYSQLND)
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_fetch_all, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_fetch_all, 0, 1, IS_ARRAY, 0)
ZEND_ARG_OBJ_INFO(0, result, mysqli_result, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "MYSQLI_NUM")
ZEND_END_ARG_INFO()
@@ -108,11 +104,11 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_fetch_array, 0, 1, MAY_BE
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_LONG, 0, "MYSQLI_BOTH")
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_fetch_assoc, 0, 1, IS_ARRAY, 1)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_fetch_assoc, 0, 1, MAY_BE_ARRAY|MAY_BE_NULL|MAY_BE_FALSE)
ZEND_ARG_OBJ_INFO(0, result, mysqli_result, 0)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_fetch_object, 0, 1, IS_OBJECT, 1)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_fetch_object, 0, 1, MAY_BE_OBJECT|MAY_BE_NULL|MAY_BE_FALSE)
ZEND_ARG_OBJ_INFO(0, result, mysqli_result, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, class, IS_STRING, 0, "\"stdClass\"")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, constructor_args, IS_ARRAY, 0, "[]")
@@ -159,13 +155,11 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_get_links_stats, 0, 0, IS_ARRAY, 0)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_get_host_info, 0, 1, IS_STRING, 0)
- ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0)
-ZEND_END_ARG_INFO()
+#define arginfo_mysqli_get_host_info arginfo_mysqli_character_set_name
#define arginfo_mysqli_get_proto_info arginfo_mysqli_errno
-#define arginfo_mysqli_get_server_info arginfo_mysqli_get_host_info
+#define arginfo_mysqli_get_server_info arginfo_mysqli_character_set_name
#define arginfo_mysqli_get_server_version arginfo_mysqli_errno
@@ -176,7 +170,9 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_mysqli_init, 0, 0, mysqli, MAY_BE_FALSE)
ZEND_END_ARG_INFO()
-#define arginfo_mysqli_info arginfo_mysqli_character_set_name
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_info, 0, 1, IS_STRING, 1)
+ ZEND_ARG_OBJ_INFO(0, mysql, mysqli, 0)
+ZEND_END_ARG_INFO()
#define arginfo_mysqli_insert_id arginfo_mysqli_affected_rows
@@ -206,13 +202,15 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_options, 0, 3, _IS_BOOL,
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO()
+#define arginfo_mysqli_set_opt arginfo_mysqli_options
+
#define arginfo_mysqli_ping arginfo_mysqli_close
#if defined(MYSQLI_USE_MYSQLND)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_poll, 0, 4, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(1, read, IS_ARRAY, 1)
- ZEND_ARG_TYPE_INFO(1, write, IS_ARRAY, 1)
- ZEND_ARG_TYPE_INFO(1, error, IS_ARRAY, 0)
+ ZEND_ARG_TYPE_INFO(1, error, IS_ARRAY, 1)
+ ZEND_ARG_TYPE_INFO(1, reject, IS_ARRAY, 0)
ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, microseconds, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()
@@ -249,6 +247,8 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_real_escape_string, 0, 2,
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
ZEND_END_ARG_INFO()
+#define arginfo_mysqli_escape_string arginfo_mysqli_real_escape_string
+
#define arginfo_mysqli_real_query arginfo_mysqli_multi_query
#if defined(MYSQLI_USE_MYSQLND)
@@ -313,7 +313,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_errno, 0, 1, IS_LONG
ZEND_ARG_OBJ_INFO(0, statement, mysqli_stmt, 0)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_error, 0, 1, IS_STRING, 1)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_error, 0, 1, IS_STRING, 0)
ZEND_ARG_OBJ_INFO(0, statement, mysqli_stmt, 0)
ZEND_END_ARG_INFO()
@@ -418,10 +418,6 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_refresh, 0, 2, _IS_BOOL,
ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 0)
ZEND_END_ARG_INFO()
-#define arginfo_mysqli_escape_string arginfo_mysqli_real_escape_string
-
-#define arginfo_mysqli_set_opt arginfo_mysqli_options
-
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli___construct, 0, 0, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, hostname, IS_STRING, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, username, IS_STRING, 1, "null")
@@ -451,10 +447,7 @@ ZEND_END_ARG_INFO()
#define arginfo_class_mysqli_close arginfo_class_mysqli_character_set_name
-ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_commit, 0, 0, 0)
- ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "-1")
- ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 1, "null")
-ZEND_END_ARG_INFO()
+#define arginfo_class_mysqli_commit arginfo_class_mysqli_begin_transaction
#define arginfo_class_mysqli_connect arginfo_class_mysqli___construct
@@ -496,8 +489,8 @@ ZEND_END_ARG_INFO()
#if defined(MYSQLI_USE_MYSQLND)
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_poll, 0, 0, 4)
ZEND_ARG_TYPE_INFO(1, read, IS_ARRAY, 1)
- ZEND_ARG_TYPE_INFO(1, write, IS_ARRAY, 1)
- ZEND_ARG_TYPE_INFO(1, error, IS_ARRAY, 0)
+ ZEND_ARG_TYPE_INFO(1, error, IS_ARRAY, 1)
+ ZEND_ARG_TYPE_INFO(1, reject, IS_ARRAY, 0)
ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, microseconds, IS_LONG, 0, "0")
ZEND_END_ARG_INFO()
@@ -878,6 +871,7 @@ static const zend_function_entry ext_functions[] = {
ZEND_FE(mysqli_num_fields, arginfo_mysqli_num_fields)
ZEND_FE(mysqli_num_rows, arginfo_mysqli_num_rows)
ZEND_FE(mysqli_options, arginfo_mysqli_options)
+ ZEND_FALIAS(mysqli_set_opt, mysqli_options, arginfo_mysqli_set_opt)
ZEND_FE(mysqli_ping, arginfo_mysqli_ping)
#if defined(MYSQLI_USE_MYSQLND)
ZEND_FE(mysqli_poll, arginfo_mysqli_poll)
@@ -887,6 +881,7 @@ static const zend_function_entry ext_functions[] = {
ZEND_FE(mysqli_query, arginfo_mysqli_query)
ZEND_FE(mysqli_real_connect, arginfo_mysqli_real_connect)
ZEND_FE(mysqli_real_escape_string, arginfo_mysqli_real_escape_string)
+ ZEND_FALIAS(mysqli_escape_string, mysqli_real_escape_string, arginfo_mysqli_escape_string)
ZEND_FE(mysqli_real_query, arginfo_mysqli_real_query)
#if defined(MYSQLI_USE_MYSQLND)
ZEND_FE(mysqli_reap_async_query, arginfo_mysqli_reap_async_query)
@@ -938,8 +933,6 @@ static const zend_function_entry ext_functions[] = {
ZEND_FE(mysqli_use_result, arginfo_mysqli_use_result)
ZEND_FE(mysqli_warning_count, arginfo_mysqli_warning_count)
ZEND_FE(mysqli_refresh, arginfo_mysqli_refresh)
- ZEND_FALIAS(mysqli_escape_string, mysqli_real_escape_string, arginfo_mysqli_escape_string)
- ZEND_FALIAS(mysqli_set_opt, mysqli_options, arginfo_mysqli_set_opt)
ZEND_FE_END
};
diff --git a/ext/opcache/Optimizer/zend_func_info.c b/ext/opcache/Optimizer/zend_func_info.c
index e3b4da720c..f987e1063f 100644
--- a/ext/opcache/Optimizer/zend_func_info.c
+++ b/ext/opcache/Optimizer/zend_func_info.c
@@ -462,12 +462,12 @@ static const func_info_t func_infos[] = {
F1("mysqli_get_charset", MAY_BE_NULL | MAY_BE_OBJECT),
F1("mysqli_fetch_array", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
F1("mysqli_fetch_assoc", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY),
- F1("mysqli_fetch_all", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
+ F1("mysqli_fetch_all", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
F1("mysqli_fetch_object", MAY_BE_NULL | MAY_BE_OBJECT),
F1("mysqli_affected_rows", MAY_BE_LONG | MAY_BE_STRING),
- F1("mysqli_character_set_name", MAY_BE_NULL | MAY_BE_STRING),
+ F1("mysqli_character_set_name", MAY_BE_STRING),
F0("mysqli_debug", MAY_BE_TRUE),
- F1("mysqli_error", MAY_BE_NULL | MAY_BE_STRING),
+ F1("mysqli_error", MAY_BE_STRING),
F1("mysqli_reap_async_query", MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_OBJECT),
F1("mysqli_stmt_get_result", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("mysqli_get_warnings", MAY_BE_FALSE | MAY_BE_OBJECT),
@@ -490,13 +490,13 @@ static const func_info_t func_infos[] = {
F1("mysqli_stmt_affected_rows", MAY_BE_LONG | MAY_BE_STRING),
F1("mysqli_stmt_insert_id", MAY_BE_LONG | MAY_BE_STRING),
F1("mysqli_stmt_num_rows", MAY_BE_LONG | MAY_BE_STRING),
- F1("mysqli_sqlstate", MAY_BE_NULL | MAY_BE_STRING),
+ F1("mysqli_sqlstate", MAY_BE_STRING),
F0("mysqli_ssl_set", MAY_BE_TRUE),
F1("mysqli_stat", MAY_BE_FALSE | MAY_BE_STRING),
- F1("mysqli_stmt_error", MAY_BE_NULL | MAY_BE_STRING),
+ F1("mysqli_stmt_error", MAY_BE_STRING),
F1("mysqli_stmt_init", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("mysqli_stmt_result_metadata", MAY_BE_FALSE | MAY_BE_OBJECT),
- F1("mysqli_stmt_sqlstate", MAY_BE_NULL | MAY_BE_STRING),
+ F1("mysqli_stmt_sqlstate", MAY_BE_STRING),
F1("mysqli_store_result", MAY_BE_FALSE | MAY_BE_OBJECT),
F1("mysqli_use_result", MAY_BE_FALSE | MAY_BE_OBJECT),