diff options
author | Dmitry Stogov <dmitry@php.net> | 2005-04-26 09:27:28 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2005-04-26 09:27:28 +0000 |
commit | 5f600cdf573a45a89694aa7edc573a44b1782297 (patch) | |
tree | ed11ea640909f94b3177b926ca3c36a7bdb165d7 /Zend/zend_API.c | |
parent | 694f7a9e908e7f6df78972aeb937bced2013586d (diff) | |
download | php-git-5f600cdf573a45a89694aa7edc573a44b1782297.tar.gz |
Fixed bug #30702 (cannot initialize class variable from class constant)
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r-- | Zend/zend_API.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 0e9f822e80..6e66cfd288 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -712,8 +712,13 @@ ZEND_API void zend_merge_properties(zval *obj, HashTable *properties, int destro ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC) { if (!class_type->constants_updated) { + zend_class_entry **scope = EG(in_execution)?&EG(scope):&CG(active_class_entry); + zend_class_entry *old_scope = *scope; + + *scope = class_type; zend_hash_apply_with_argument(&class_type->default_properties, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC); zend_hash_apply_with_argument(class_type->static_members, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC); + *scope = old_scope; class_type->constants_updated = 1; } } |