. The mysqli_driver::$driver_version property has been deprecated. The driver
version is meaningless as it hasn't been updated in more than a decade. Use
PHP_VERSION_ID instead.
+ . Calling mysqli::get_client_info in OO style or passing $mysqli argument to
+ mysqli_get_client_info() function has been deprecated. Use
+ mysqli_get_client_info() without any arguments to obtain the client
+ library version information.
========================================
5. Changed Functions
/**
* @return string|null
* @alias mysqli_get_client_info
+ * @deprecated 8.1.0
*/
public function get_client_info() {}
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|O!", &mysql_link, mysqli_link_class_entry) == FAILURE) {
RETURN_THROWS();
}
+
+ if (ZEND_NUM_ARGS()) {
+ php_error_docref(NULL, E_DEPRECATED, "Passing connection object as an argument is deprecated");
+ }
}
RETURN_STRING(mysql_get_client_info());
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 56499df713b79c1e9efc19cf8be45aa98028172c */
+ * Stub hash: e65b3497e7783d55f3dfd4cd89be65094c59b1d3 */
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)
ZEND_ME_MAPPING(dump_debug_info, mysqli_dump_debug_info, arginfo_class_mysqli_dump_debug_info, ZEND_ACC_PUBLIC)
ZEND_ME_MAPPING(debug, mysqli_debug, arginfo_class_mysqli_debug, ZEND_ACC_PUBLIC)
ZEND_ME_MAPPING(get_charset, mysqli_get_charset, arginfo_class_mysqli_get_charset, ZEND_ACC_PUBLIC)
- ZEND_ME_MAPPING(get_client_info, mysqli_get_client_info, arginfo_class_mysqli_get_client_info, ZEND_ACC_PUBLIC)
+ ZEND_ME_MAPPING(get_client_info, mysqli_get_client_info, arginfo_class_mysqli_get_client_info, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED)
#if defined(MYSQLI_USE_MYSQLND)
ZEND_ME_MAPPING(get_connection_stats, mysqli_get_connection_stats, arginfo_class_mysqli_get_connection_stats, ZEND_ACC_PUBLIC)
#endif
}
/* following operations should work */
- $x[1] = ($mysql->client_version > 0);
+ $x[1] = ($mysql->error);
$x[2] = $mysql->errno;
$mysql->close();
mysqli object is not fully initialized
array(2) {
[1]=>
- bool(true)
+ string(0) ""
[2]=>
int(0)
}
--- /dev/null
+--TEST--
+Deprecated messages for mysqli::get_client_info() method
+--SKIPIF--
+<?php
+require_once 'skipif.inc';
+require_once 'skipifconnectfailure.inc';
+?>
+--FILE--
+<?php
+require 'connect.inc';
+
+if (!$mysqli = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
+ printf("Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
+ $host, $user, $db, $port, $socket);
+ exit(1);
+}
+
+printf("client_info = '%s'\n", $mysqli->get_client_info());
+
+printf("client_info = '%s'\n", mysqli_get_client_info($mysqli));
+
+print "done!";
+?>
+--EXPECTF--
+
+Deprecated: Method mysqli::get_client_info() is deprecated in %s
+client_info = '%s'
+
+Deprecated: mysqli_get_client_info(): Passing connection object as an argument is deprecated in %s
+client_info = '%s'
+done!