diff options
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r-- | Zend/zend_API.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 6ce60e1f06..a71aca8106 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -3886,6 +3886,24 @@ ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, c } /* }}} */ +ZEND_API void zend_unset_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length) /* {{{ */ +{ + zval property; + zend_class_entry *old_scope = EG(scope); + + EG(scope) = scope; + + if (!Z_OBJ_HT_P(object)->unset_property) { + zend_error_noreturn(E_CORE_ERROR, "Property %s of class %s cannot be unset", name, ZSTR_VAL(Z_OBJCE_P(object)->name)); + } + ZVAL_STRINGL(&property, name, name_length); + Z_OBJ_HT_P(object)->unset_property(object, &property, 0); + zval_ptr_dtor(&property); + + EG(scope) = old_scope; +} +/* }}} */ + ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_long value) /* {{{ */ { zval tmp; |