diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index 5424a3f3d04..438552335e0 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -306,19 +306,19 @@ static int mysqli_object_has_property(zend_object *object, zend_string *name, in { mysqli_object *obj = php_mysqli_fetch_object(object); mysqli_prop_handler *p; - int ret = 0; + bool has_property = false; if ((p = zend_hash_find_ptr(obj->prop_handler, name)) != NULL) { switch (has_set_exists) { case ZEND_PROPERTY_EXISTS: - ret = 1; + has_property = true; break; case ZEND_PROPERTY_NOT_EMPTY: { zval rv; zval *value = mysqli_read_property(object, name, BP_VAR_IS, cache_slot, &rv); if (value != &EG(uninitialized_zval)) { convert_to_boolean(value); - ret = Z_TYPE_P(value) == IS_TRUE ? 1 : 0; + has_property = Z_TYPE_P(value) == IS_TRUE; } break; } @@ -326,7 +326,7 @@ static int mysqli_object_has_property(zend_object *object, zend_string *name, in zval rv; zval *value = mysqli_read_property(object, name, BP_VAR_IS, cache_slot, &rv); if (value != &EG(uninitialized_zval)) { - ret = Z_TYPE_P(value) != IS_NULL? 1 : 0; + has_property = Z_TYPE_P(value) != IS_NULL; zval_ptr_dtor(value); } break; @@ -334,10 +334,10 @@ static int mysqli_object_has_property(zend_object *object, zend_string *name, in EMPTY_SWITCH_DEFAULT_CASE(); } } else { - ret = zend_std_has_property(object, name, has_set_exists, cache_slot); + has_property = zend_std_has_property(object, name, has_set_exists, cache_slot); } - return ret; + return has_property; } /* }}} */ HashTable *mysqli_object_get_debug_info(zend_object *object, int *is_temp)