From ca64b41b9900f39a41732fd825a53e87d2f5ea66 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 21 May 2015 04:13:10 +0300 Subject: Fixed zend_update_class_constants() to always resolve all constants. Call zend_update_class_constants() only when necessary. --- Zend/zend_builtin_functions.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Zend/zend_builtin_functions.c') diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 7313b32065..6b65bdd330 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -1105,8 +1105,10 @@ ZEND_FUNCTION(get_class_vars) RETURN_FALSE; } else { array_init(return_value); - if (UNEXPECTED(zend_update_class_constants(ce) != SUCCESS)) { - return; + if (UNEXPECTED(!(ce->ce_flags & ZEND_ACC_CONSTANTS_UPDATED))) { + if (UNEXPECTED(zend_update_class_constants(ce) != SUCCESS)) { + return; + } } add_class_vars(ce, 0, return_value); add_class_vars(ce, 1, return_value); -- cgit v1.2.1