[PATCH for ZE] fix for #29504
| From: | Antony Dovgal | Date: | Tue, 03 Aug 2004 12:56:58 +0000 |
| Subject: | [PATCH for ZE] fix for #29504 | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-11872@lists.php.net to get a copy of this message | ||
Hi all!
In attachment you can find really tiny patch, that fixes #29504 (improper handling of default array
properties).
---
WBR,
Antony Dovgal aka tony2001
tony2001@phpclub.net || antony@dovgal.com
Index: zend_builtin_functions.c =================================================================== RCS file: /repository/ZendEngine2/zend_builtin_functions.c,v retrieving revision 1.242 diff -u -r1.242 zend_builtin_functions.c --- zend_builtin_functions.c 27 Jul 2004 01:33:25 -0000 1.242 +++ zend_builtin_functions.c 3 Aug 2004 12:48:24 -0000 @@ -702,6 +702,12 @@ 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_ARRAY; + } + add_assoc_zval(return_value, prop_name, prop_copy); } }
Index: zend_builtin_functions.c =================================================================== RCS file: /repository/ZendEngine2/zend_builtin_functions.c,v retrieving revision 1.242 diff -u -r1.242 zend_builtin_functions.c --- zend_builtin_functions.c 27 Jul 2004 01:33:25 -0000 1.242 +++ zend_builtin_functions.c 3 Aug 2004 12:48:24 -0000 @@ -702,6 +702,12 @@ 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_ARRAY; + } + add_assoc_zval(return_value, prop_name, prop_copy); } }