summaryrefslogtreecommitdiff
path: root/ext/json/json.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/json/json.c')
-rw-r--r--ext/json/json.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/json/json.c b/ext/json/json.c
index 1bfe3e0743..809d005c57 100644
--- a/ext/json/json.c
+++ b/ext/json/json.c
@@ -177,7 +177,7 @@ static void json_encode_array(smart_str *buf, zval **val TSRMLS_DC) {
json_encode_r(buf, *data TSRMLS_CC);
} else if (r == 1) {
if (i == HASH_KEY_IS_STRING) {
- if (key[0] == '\0') {
+ if (key[0] == '\0' && Z_TYPE_PP(val) == IS_OBJECT) {
/* Skip protected and private members. */
continue;
}