summaryrefslogtreecommitdiff
path: root/Zend/zend_API.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2015-05-06 10:51:52 +0800
committerXinchen Hui <laruence@php.net>2015-05-06 10:51:52 +0800
commit55d94a453243cafc2292920e9c91bd2bc551f2be (patch)
treec00d368a3c68c2e53167b8da8c6448cdb88801e7 /Zend/zend_API.c
parent9b3a92a1cad96ff88a61493bf688bc0757933642 (diff)
parent63282d3321044681e880a997a6360d4b99a07d4f (diff)
downloadphp-git-55d94a453243cafc2292920e9c91bd2bc551f2be.tar.gz
Merge branch 'master' of git.php.net:php-src
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r--Zend/zend_API.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index e55ec45af6..7f8587ab4f 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -3828,6 +3828,23 @@ ZEND_API int zend_declare_class_constant_string(zend_class_entry *ce, const char
}
/* }}} */
+ZEND_API void zend_update_property_ex(zend_class_entry *scope, zval *object, zend_string *name, zval *value) /* {{{ */
+{
+ zval property;
+ zend_class_entry *old_scope = EG(scope);
+
+ EG(scope) = scope;
+
+ if (!Z_OBJ_HT_P(object)->write_property) {
+ zend_error_noreturn(E_CORE_ERROR, "Property %s of class %s cannot be updated", name, Z_OBJCE_P(object)->name->val);
+ }
+ ZVAL_STR(&property, name);
+ Z_OBJ_HT_P(object)->write_property(object, &property, value, NULL);
+
+ EG(scope) = old_scope;
+}
+/* }}} */
+
ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zval *value) /* {{{ */
{
zval property;