From 5bf6aedae4556facb8b407426a13c4e8d5399dd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Sun, 5 Jan 2020 19:49:34 +0100 Subject: Promote mysqli warnings to exceptions Closes GH-5058 --- ext/mysqli/mysqli.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ext/mysqli/mysqli.c') diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index ba12ea1a80..cbfbb451bc 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -312,7 +312,7 @@ zval *mysqli_read_property(zend_object *object, zend_string *name, int type, voi } if (hnd) { - if (hnd->read_func(obj, rv, type == BP_VAR_IS) == SUCCESS || type != BP_VAR_IS) { + if (hnd->read_func(obj, rv, type == BP_VAR_IS) == SUCCESS) { retval = rv; } else { retval = &EG(uninitialized_zval); @@ -409,6 +409,7 @@ HashTable *mysqli_object_get_debug_info(zend_object *object, int *is_temp) ZEND_HASH_FOREACH_PTR(props, entry) { zval rv; zval *value; + value = mysqli_read_property(object, entry->name, BP_VAR_IS, 0, &rv); if (value != &EG(uninitialized_zval)) { zend_hash_add(retval, entry->name, value); @@ -470,7 +471,7 @@ static MYSQLND *mysqli_convert_zv_to_mysqlnd(zval * zv) mysqli_object *intern = Z_MYSQLI_P(zv); if (!(my_res = (MYSQLI_RESOURCE *)intern->ptr)) { /* We know that we have a mysqli object, so this failure should be emitted */ - php_error_docref(NULL, E_WARNING, "Couldn't fetch %s", ZSTR_VAL(intern->zo.ce->name)); + zend_throw_error(NULL, "%s object is already closed", ZSTR_VAL(intern->zo.ce->name)); return NULL; } mysql = (MY_MYSQL *)(my_res->ptr); -- cgit v1.2.1