From fac1e871713d4117cfb5f108f235f60e313f99da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustavo=20Andr=C3=A9=20dos=20Santos=20Lopes?= Date: Thu, 3 Feb 2011 12:38:25 +0000 Subject: - Fixed bug #53915: ReflectionClass::getConstant(s) emits fatal error on constants with self::. - Reflown some NEWS entries to have lines no longer than 80 chars. --- ext/reflection/php_reflection.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'ext/reflection/php_reflection.c') diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 4afeef3669..b89d53581d 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -3731,6 +3731,11 @@ ZEND_METHOD(reflection_class, hasConstant) } /* }}} */ +static int _update_constant_ex_cb_wrapper(void *pDest, void *ce TSRMLS_DC) +{ + return zval_update_constant_ex(pDest, (void*)(zend_uintptr_t)1U, ce); +} + /* {{{ proto public array ReflectionClass::getConstants() Returns an associative array containing this class' constants and their values */ ZEND_METHOD(reflection_class, getConstants) @@ -3744,7 +3749,7 @@ ZEND_METHOD(reflection_class, getConstants) } 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_apply_with_argument(&ce->constants_table, _update_constant_ex_cb_wrapper, ce 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 *)); } /* }}} */ @@ -3765,7 +3770,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); + zend_hash_apply_with_argument(&ce->constants_table, _update_constant_ex_cb_wrapper, ce TSRMLS_CC); if (zend_hash_find(&ce->constants_table, name, name_len + 1, (void **) &value) == FAILURE) { RETURN_FALSE; } -- cgit v1.2.1