From: Marcus Boerger Date: Wed, 24 Nov 2004 19:59:28 +0000 (+0000) Subject: - MFH Bugfix #30856 X-Git-Tag: php-5.0.3RC1~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=41639646127d43fcda3b96b2883d431dfcf07857;p=php - MFH Bugfix #30856 --- diff --git a/Zend/zend_reflection_api.c b/Zend/zend_reflection_api.c index 3b2d282963..6df08266a8 100644 --- a/Zend/zend_reflection_api.c +++ b/Zend/zend_reflection_api.c @@ -2127,6 +2127,13 @@ ZEND_METHOD(reflection_class, getStaticProperties) METHOD_NOTSTATIC_NUMPARAMS(0); GET_REFLECTION_OBJECT_PTR(ce); + + if (!ce->constants_updated) { + zend_hash_apply_with_argument(&ce->default_properties, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC); + zend_hash_apply_with_argument(ce->static_members, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC); + ce->constants_updated = 1; + } + array_init(return_value); zend_hash_copy(Z_ARRVAL_P(return_value), ce->static_members, (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *)); } diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 3b2d282963..6df08266a8 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2127,6 +2127,13 @@ ZEND_METHOD(reflection_class, getStaticProperties) METHOD_NOTSTATIC_NUMPARAMS(0); GET_REFLECTION_OBJECT_PTR(ce); + + if (!ce->constants_updated) { + zend_hash_apply_with_argument(&ce->default_properties, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC); + zend_hash_apply_with_argument(ce->static_members, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC); + ce->constants_updated = 1; + } + array_init(return_value); zend_hash_copy(Z_ARRVAL_P(return_value), ce->static_members, (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *)); }