From 9158cd24943dce73b270fc07207e2e9505263711 Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Tue, 3 Aug 2004 17:02:35 +0000 Subject: [PATCH] - MFH Bug #29505 get_class_vars() severely broken when used with arrays --- Zend/zend_builtin_functions.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 734baf522a..791159f619 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -701,6 +701,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); } } -- 2.40.0