Closure and SplFileInfo using exceptions). (Etienne)
- Fixed bug #46268 (DateTime::modify() does not reset relative time values).
(Derick)
+- Fixed bug #46044 (Mysqli - wrong error message). (Johannes)
- Fixed bug #45991 (Ini files with the UTF-8 BOM are treated as invalid).
(Scott)
- Fixed bug #45989 (json_decode() doesn't return NULL on certain invalid
}
/* }}} */
-static union _zend_function *php_mysqli_constructor_get(zval *object TSRMLS_DC)
-{
- zend_class_entry * ce = Z_OBJCE_P(object);
-
- if (ce != mysqli_link_class_entry && ce != mysqli_stmt_class_entry &&
- ce != mysqli_result_class_entry && ce != mysqli_driver_class_entry &&
- ce != mysqli_warning_class_entry) {
- return zend_std_get_constructor(object TSRMLS_CC);
- } else {
- static zend_internal_function f;
- mysqli_object *obj = (mysqli_object *)zend_objects_get_address(object TSRMLS_CC);
-
- f.function_name = obj->zo.ce->name;
- f.scope = obj->zo.ce;
- f.arg_info = NULL;
- f.num_args = 0;
- f.fn_flags = 0;
-
- f.type = ZEND_INTERNAL_FUNCTION;
- if (obj->zo.ce == mysqli_link_class_entry) {
- f.handler = ZEND_FN(mysqli_link_construct);
- } else if (obj->zo.ce == mysqli_stmt_class_entry) {
- f.handler = ZEND_FN(mysqli_stmt_construct);
- } else if (obj->zo.ce == mysqli_result_class_entry) {
- f.handler = ZEND_FN(mysqli_result_construct);
- } else if (obj->zo.ce == mysqli_driver_class_entry) {
- f.handler = ZEND_FN(mysqli_driver_construct);
- } else if (obj->zo.ce == mysqli_warning_class_entry) {
- f.handler = ZEND_MN(mysqli_warning___construct);
- }
-
- return (union _zend_function*)&f;
- }
-}
-
static int mysqli_object_has_property(zval *object, zval *member, int has_set_exists TSRMLS_DC) /* {{{ */
{
mysqli_object *obj = (mysqli_object *)zend_objects_get_address(object TSRMLS_CC);
mysqli_object_handlers.read_property = mysqli_read_property;
mysqli_object_handlers.write_property = mysqli_write_property;
mysqli_object_handlers.get_property_ptr_ptr = std_hnd->get_property_ptr_ptr;
- mysqli_object_handlers.get_constructor = php_mysqli_constructor_get;
mysqli_object_handlers.has_property = mysqli_object_has_property;
#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3
mysqli_object_handlers.get_debug_info = mysqli_object_get_debug_info;
$mysql->query("INSERT INTO test_warnings VALUES (1),(2),(NULL)");
- if (($warning = new mysqli_warning($mysql))) {
+ if (($warning = $mysql->get_warnings())) {
do {
printf("Warning\n");
} while ($warning->next());
?>
--EXPECT--
Warning
-done!
\ No newline at end of file
+done!
$mysql->query("CREATE TABLE test_warnings (a int not null)");
$mysql->query("SET sql_mode=''");
$mysql->query("INSERT INTO test_warnings VALUES (1),(2),(NULL)");
- var_dump(new mysqli_warning($mysql));
+ var_dump($mysql->get_warnings());
}
}
Constructor:
-Warning: mysqli_result::mysqli_result() expects parameter 2 to be long, string given in %s on line %d
+Warning: mysqli_result::__construct() expects parameter 2 to be long, string given in %s on line %d
-Warning: mysqli_result::mysqli_result() expects parameter 1 to be mysqli, string given in %s on line %d
+Warning: mysqli_result::__construct() expects parameter 1 to be mysqli, string given in %s on line %d
done!
--UEXPECTF--
Parent class:
Constructor:
-Warning: mysqli_result::mysqli_result() expects parameter 2 to be long, Unicode string given in %s on line %d
+Warning: mysqli_result::__construct() expects parameter 2 to be long, Unicode string given in %s on line %d
-Warning: mysqli_result::mysqli_result() expects parameter 1 to be mysqli, Unicode string given in %s on line %d
+Warning: mysqli_result::__construct() expects parameter 1 to be mysqli, Unicode string given in %s on line %d
done!
Prepare using the constructor:
-Warning: mysqli_stmt::mysqli_stmt() expects parameter 2 to be string, object given in %s on line %d
+Warning: mysqli_stmt::__construct() expects parameter 2 to be string, object given in %s on line %d
done!
--UEXPECTF--
Parent class:
Prepare using the constructor:
-Warning: mysqli_stmt::mysqli_stmt() expects parameter 2 to be binary string, object given in %s on line %d
+Warning: mysqli_stmt::__construct() expects parameter 2 to be binary string, object given in %s on line %d
done!
print "done!";
?>
--EXPECTF--
-Warning: mysqli_result::mysqli_result(): Invalid value for resultmode in %s on line %d
+Warning: mysqli_result::__construct(): Invalid value for resultmode in %s on line %d
done!