summaryrefslogtreecommitdiff
path: root/ext/mysqli/mysqli.c
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2020-01-28 18:51:00 +0100
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-01-28 18:51:00 +0100
commitcffff1fb03f995cbe07896d317e4c367e0db89c2 (patch)
tree7262bf955a8ab033347bf50716e583ccbe4615cd /ext/mysqli/mysqli.c
parent38d205a5b1c032ed0e35383cfe86858b9859df93 (diff)
parentd39edebbce35890aafd77cc47e1830e851287219 (diff)
downloadphp-git-cffff1fb03f995cbe07896d317e4c367e0db89c2.tar.gz
Merge branch 'PHP-7.4'
* Fix #78666 mysqli_options generates Warning on var_dump()
Diffstat (limited to 'ext/mysqli/mysqli.c')
-rw-r--r--ext/mysqli/mysqli.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index f9404af4d8..ba12ea1a80 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -67,7 +67,7 @@ zend_class_entry *mysqli_warning_class_entry;
zend_class_entry *mysqli_exception_class_entry;
-typedef zval *(*mysqli_read_t)(mysqli_object *obj, zval *rv);
+typedef int (*mysqli_read_t)(mysqli_object *obj, zval *rv, zend_bool quiet);
typedef int (*mysqli_write_t)(mysqli_object *obj, zval *newval);
typedef struct _mysqli_prop_handler {
@@ -279,10 +279,13 @@ static void mysqli_warning_free_storage(zend_object *object)
/* }}} */
/* {{{ mysqli_read_na */
-static zval *mysqli_read_na(mysqli_object *obj, zval *retval)
+static int mysqli_read_na(mysqli_object *obj, zval *retval, zend_bool quiet)
{
- zend_throw_error(NULL, "Cannot read property");
- return NULL;
+ if (!quiet) {
+ zend_throw_error(NULL, "Cannot read property");
+ }
+
+ return FAILURE;
}
/* }}} */
@@ -290,6 +293,7 @@ static zval *mysqli_read_na(mysqli_object *obj, zval *retval)
static int mysqli_write_na(mysqli_object *obj, zval *newval)
{
zend_throw_error(NULL, "Cannot write property");
+
return FAILURE;
}
/* }}} */
@@ -308,8 +312,9 @@ zval *mysqli_read_property(zend_object *object, zend_string *name, int type, voi
}
if (hnd) {
- retval = hnd->read_func(obj, rv);
- if (retval == NULL) {
+ if (hnd->read_func(obj, rv, type == BP_VAR_IS) == SUCCESS || type != BP_VAR_IS) {
+ retval = rv;
+ } else {
retval = &EG(uninitialized_zval);
}
} else {