diff options
-rw-r--r-- | Zend/zend_API.c | 15 | ||||
-rw-r--r-- | Zend/zend_API.h | 1 | ||||
-rw-r--r-- | ext/reflection/php_reflection.c | 6 |
3 files changed, 13 insertions, 9 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c index b643c5ffff..98312b3464 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -4175,21 +4175,28 @@ ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, const c } /* }}} */ -ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, size_t name_length, zend_bool silent) /* {{{ */ +ZEND_API zval *zend_read_static_property_ex(zend_class_entry *scope, zend_string *name, zend_bool silent) /* {{{ */ { zval *property; zend_class_entry *old_scope = EG(fake_scope); - zend_string *key = zend_string_init(name, name_length, 0); EG(fake_scope) = scope; - property = zend_std_get_static_property(scope, key, silent); + property = zend_std_get_static_property(scope, name, silent); EG(fake_scope) = old_scope; - zend_string_efree(key); return property; } /* }}} */ +ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, size_t name_length, zend_bool silent) /* {{{ */ +{ + zend_string *key = zend_string_init(name, name_length, 0); + zval *property = zend_std_get_static_property(scope, key, silent); + zend_string_efree(key); + return property; +} +/* }}} */ + ZEND_API void zend_save_error_handling(zend_error_handling *current) /* {{{ */ { current->handling = EG(error_handling); diff --git a/Zend/zend_API.h b/Zend/zend_API.h index b9fdb76cc4..64a6bde19e 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -356,6 +356,7 @@ ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, const ZEND_API zval *zend_read_property_ex(zend_class_entry *scope, zval *object, zend_string *name, zend_bool silent, zval *rv); ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_bool silent, zval *rv); +ZEND_API zval *zend_read_static_property_ex(zend_class_entry *scope, zend_string *name, zend_bool silent); ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, size_t name_length, zend_bool silent); ZEND_API char *zend_get_type_by_const(int type); diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 6300e4a4e5..e7bfb272d5 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -5496,11 +5496,7 @@ ZEND_METHOD(reflection_property, getValue) } if (ref->prop.flags & ZEND_ACC_STATIC) { - zend_class_entry *old_scope = EG(fake_scope); - EG(fake_scope) = ref->ce; - member_p = zend_std_get_static_property(ref->ce, ref->unmangled_name, 0); - EG(fake_scope) = old_scope; - + member_p = zend_read_static_property_ex(ref->ce, ref->unmangled_name, 0); if (member_p) { ZVAL_DEREF(member_p); ZVAL_COPY(return_value, member_p); |