diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2018-06-29 22:56:47 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2018-06-29 22:56:59 +0200 |
commit | 7ac06d66d4e19dc68b0440aff27f2a405354e5d6 (patch) | |
tree | 1b59442c8a0baa88393105ab1e793de486135b3c /ext/reflection/php_reflection.c | |
parent | 813b6fc95050b32409014877e7dc9849c16717ee (diff) | |
download | php-git-7ac06d66d4e19dc68b0440aff27f2a405354e5d6.tar.gz |
Add zend_update_static_property_ex API
And cleanup the implementation to perform a normal by-value
assignment.
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index e7bfb272d5..4f46bd1ff8 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -5533,7 +5533,6 @@ ZEND_METHOD(reflection_property, setValue) { reflection_object *intern; property_reference *ref; - zval *variable_ptr; zval *object, *name; zval *value; zval *tmp; @@ -5549,26 +5548,13 @@ ZEND_METHOD(reflection_property, setValue) } if (ref->prop.flags & ZEND_ACC_STATIC) { - zend_class_entry *old_scope; - zval garbage; - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "z", &value) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "zz", &tmp, &value) == FAILURE) { return; } } - old_scope = EG(fake_scope); - EG(fake_scope) = ref->ce; - variable_ptr = zend_std_get_static_property(ref->ce, ref->unmangled_name, 0); - EG(fake_scope) = old_scope; - - ZVAL_DEREF(variable_ptr); - ZVAL_DEREF(value); - - ZVAL_COPY_VALUE(&garbage, variable_ptr); - ZVAL_COPY(variable_ptr, value); - zval_ptr_dtor(&garbage); + zend_update_static_property_ex(ref->ce, ref->unmangled_name, value); } else { if (zend_parse_parameters(ZEND_NUM_ARGS(), "oz", &object, &value) == FAILURE) { return; |