From: Marcus Boerger Date: Tue, 3 Aug 2004 16:59:25 +0000 (+0000) Subject: - Fixed Bug #29505 get_class_vars() severely broken when used with arrays X-Git-Tag: PRE_ZEND_VM_DISPATCH_PATCH~251 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7bfc91c3a994fc26cdb4bf612331f1d6567eb1ed;p=php - Fixed Bug #29505 get_class_vars() severely broken when used with arrays --- diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 80a78afcac..b64ad5ffd9 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -702,6 +702,12 @@ ZEND_FUNCTION(get_class_vars) zval_copy_ctor(prop_copy); INIT_PZVAL(prop_copy); + /* this is necessary to make it able to work with default array + * properties, returned to user */ + if (Z_TYPE_P(prop_copy) == IS_CONSTANT_ARRAY || Z_TYPE_P(prop_copy) == IS_CONSTANT) { + zval_update_constant(&prop_copy, 0 TSRMLS_CC); + } + add_assoc_zval(return_value, prop_name, prop_copy); } }