From: Marcus Boerger Date: Mon, 16 Aug 2004 08:49:48 +0000 (+0000) Subject: MFH: Fix bug #29447: Reflection API issues X-Git-Tag: php-5.0.2RC1~128 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8823289f9fb79e33a382629f23e0c432f7c779cc;p=php MFH: Fix bug #29447: Reflection API issues --- diff --git a/Zend/zend_reflection_api.c b/Zend/zend_reflection_api.c index c59a11d9a5..35ad935c23 100644 --- a/Zend/zend_reflection_api.c +++ b/Zend/zend_reflection_api.c @@ -2304,6 +2304,7 @@ ZEND_METHOD(reflection_class, getConstants) METHOD_NOTSTATIC_NUMPARAMS(0); GET_REFLECTION_OBJECT_PTR(ce); array_init(return_value); + zend_hash_apply_with_argument(&ce->constants_table, (apply_func_arg_t) zval_update_constant, (void*)1 TSRMLS_CC); zend_hash_copy(Z_ARRVAL_P(return_value), &ce->constants_table, (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *)); } /* }}} */ @@ -2324,6 +2325,7 @@ ZEND_METHOD(reflection_class, getConstant) } GET_REFLECTION_OBJECT_PTR(ce); + zend_hash_apply_with_argument(&ce->constants_table, (apply_func_arg_t) zval_update_constant, (void*)1 TSRMLS_CC); if (zend_hash_find(&ce->constants_table, name, name_len + 1, (void **) &value) == FAILURE) { RETURN_FALSE; } diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index c59a11d9a5..35ad935c23 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2304,6 +2304,7 @@ ZEND_METHOD(reflection_class, getConstants) METHOD_NOTSTATIC_NUMPARAMS(0); GET_REFLECTION_OBJECT_PTR(ce); array_init(return_value); + zend_hash_apply_with_argument(&ce->constants_table, (apply_func_arg_t) zval_update_constant, (void*)1 TSRMLS_CC); zend_hash_copy(Z_ARRVAL_P(return_value), &ce->constants_table, (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *)); } /* }}} */ @@ -2324,6 +2325,7 @@ ZEND_METHOD(reflection_class, getConstant) } GET_REFLECTION_OBJECT_PTR(ce); + zend_hash_apply_with_argument(&ce->constants_table, (apply_func_arg_t) zval_update_constant, (void*)1 TSRMLS_CC); if (zend_hash_find(&ce->constants_table, name, name_len + 1, (void **) &value) == FAILURE) { RETURN_FALSE; }