summaryrefslogtreecommitdiff
path: root/Zend/zend_builtin_functions.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2014-04-01 21:19:44 +0400
committerDmitry Stogov <dmitry@zend.com>2014-04-01 21:19:44 +0400
commit8ddda2f649f3b13db3f4cfc48710637c823464d1 (patch)
tree1176811085e81abd52989da1ce68bdb7abe3ba1f /Zend/zend_builtin_functions.c
parent8dedaf8512d7292c9df90bebae91362ba36e7a97 (diff)
downloadphp-git-8ddda2f649f3b13db3f4cfc48710637c823464d1.tar.gz
Avoid unnecessry reallocation
Diffstat (limited to 'Zend/zend_builtin_functions.c')
-rw-r--r--Zend/zend_builtin_functions.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index be68653eeb..de397b921b 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -1015,10 +1015,14 @@ ZEND_FUNCTION(get_object_vars)
}
if (zend_hash_get_current_key_ex(properties, &key, &num_index, 0, &pos) == HASH_KEY_IS_STRING) {
if (zend_check_property_access(zobj, key TSRMLS_CC) == SUCCESS) {
- zend_unmangle_property_name_ex(key->val, key->len, &class_name, &prop_name, (int*) &prop_len);
/* Not separating references */
if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value);
- add_assoc_zval_ex(return_value, prop_name, prop_len, value);
+ if (key->val[0] == 0) {
+ zend_unmangle_property_name_ex(key->val, key->len, &class_name, &prop_name, (int*) &prop_len);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), prop_name, prop_len, value);
+ } else {
+ zend_hash_update(Z_ARRVAL_P(return_value), key, value);
+ }
}
}
zend_hash_move_forward_ex(properties, &pos);