summaryrefslogtreecommitdiff
path: root/ext/json/json_parser.y
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2019-01-31 18:47:58 +0300
committerDmitry Stogov <dmitry@zend.com>2019-02-04 13:20:25 +0300
commit91ef4124e56a8ec52078bdcb5547ea5dbf654566 (patch)
tree14285f0ab29d8274b8aeb7003ca7d0c77bbd604f /ext/json/json_parser.y
parent0476d558272c18778f95c0368e18108771a63d99 (diff)
downloadphp-git-91ef4124e56a8ec52078bdcb5547ea5dbf654566.tar.gz
Refactor zend_object_handlers API to pass zend_object* and zend_string* insted of zval(s).
Diffstat (limited to 'ext/json/json_parser.y')
-rw-r--r--ext/json/json_parser.y4
1 files changed, 1 insertions, 3 deletions
diff --git a/ext/json/json_parser.y b/ext/json/json_parser.y
index aa37c03658..e251d6e0d4 100644
--- a/ext/json/json_parser.y
+++ b/ext/json/json_parser.y
@@ -274,7 +274,6 @@ static int php_json_parser_object_update(php_json_parser *parser, zval *object,
if (Z_TYPE_P(object) == IS_ARRAY) {
zend_symtable_update(Z_ARRVAL_P(object), key, zvalue);
} else {
- zval zkey;
if (ZSTR_LEN(key) > 0 && ZSTR_VAL(key)[0] == '\0') {
parser->scanner.errcode = PHP_JSON_ERROR_INVALID_PROPERTY_NAME;
zend_string_release_ex(key, 0);
@@ -282,8 +281,7 @@ static int php_json_parser_object_update(php_json_parser *parser, zval *object,
zval_ptr_dtor_nogc(object);
return FAILURE;
}
- ZVAL_NEW_STR(&zkey, key);
- zend_std_write_property(object, &zkey, zvalue, NULL);
+ zend_std_write_property(Z_OBJ_P(object), key, zvalue, NULL);
Z_TRY_DELREF_P(zvalue);
}
zend_string_release_ex(key, 0);