]> granicus.if.org Git - php/commitdiff
ctor_params of mysqli_fetch_object should use "a"
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 6 Jun 2019 12:16:25 +0000 (14:16 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 17 Jun 2019 09:46:23 +0000 (11:46 +0200)
ext/mysqli/mysqli.c
ext/mysqli/tests/mysqli_fetch_object.phpt
ext/mysqli/tests/mysqli_fetch_object_oo.phpt

index 61d97b2a9bc1db3a86481d2eba030084e635dcff..9d065917cb05d45ed0535eca65e0cb6d61c431db 100644 (file)
@@ -1198,7 +1198,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
        if (into_object) {
                zend_string *class_name = NULL;
 
-               if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|Sz", &mysql_result, mysqli_result_class_entry, &class_name, &ctor_params) == FAILURE) {
+               if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|Sa", &mysql_result, mysqli_result_class_entry, &class_name, &ctor_params) == FAILURE) {
                        return;
                }
                if (class_name == NULL) {
index 262b48d49ff4a2dfbebad456222a8df377e65108..3230162ce77b44ee648395927d4c9741166177a8 100644 (file)
@@ -142,6 +142,6 @@ NULL
 NULL
 [E_WARNING] mysqli_fetch_object(): Couldn't fetch mysqli_result in %s on line %d
 bool(false)
-[0] Argument 3 passed to mysqli_fetch_object() must be of the type array, string given in %s on line %d
+[0] mysqli_fetch_object() expects parameter 3 to be array, string given in %s on line %d
 
 Fatal error: Class 'this_class_does_not_exist' not found in %s on line %d
index 2688f050fac493eb55ea354cf50011b4a86bdb32..a81cb7f80ac3c1d403257875c66dcab3c55c4249 100644 (file)
@@ -123,12 +123,12 @@ require_once('skipifconnectfailure.inc');
        require_once("clean_table.inc");
 ?>
 --EXPECTF--
-[E_WARNING] mysqli_result::__construct(): invalid object or resource mysql%s
-%s on line %d
+[E_WARNING] mysqli_result::__construct(): invalid object or resource mysqli
+ in %s on line %d
 [E_WARNING] mysqli_result::fetch_object(): Couldn't fetch mysqli_result in %s on line %d
-[0] Argument 2 passed to mysqli_result::fetch_object() must be of the type array, object given in %s on line %d
-[0] Argument 2 passed to mysqli_result::fetch_object() must be of the type array, object given in %s on line %d
-[0] Argument 2 passed to mysqli_result::fetch_object() must be of the type array, null given in %s on line %d
+[0] mysqli_result::fetch_object() expects parameter 1 to be string, object given in %s on line %d
+[0] mysqli_result::fetch_object() expects at most 2 parameters, 3 given in %s on line %d
+[0] mysqli_result::fetch_object() expects parameter 2 to be array, null given in %s on line %d
 Exception: Too few arguments to function mysqli_fetch_object_construct::__construct(), 1 passed and exactly 2 expected
 NULL
 NULL