|
|
Choosing A Webhost: |
cvs: ZendEngine2(PHP_5_0) / zend_builtin_functions.c /tests bug29505.phpt: msg#00014php.cvs.zend
helly Tue Aug 3 13:02:35 2004 EDT Added files: (Branch: PHP_5_0) /ZendEngine2/tests bug29505.phpt Modified files: /ZendEngine2 zend_builtin_functions.c Log: - MFH Bug #29505 get_class_vars() severely broken when used with arrays http://cvs.php.net/diff.php/ZendEngine2/zend_builtin_functions.c?r1=1.239.2.2&r2=1.239.2.3&ty=u Index: ZendEngine2/zend_builtin_functions.c diff -u ZendEngine2/zend_builtin_functions.c:1.239.2.2 ZendEngine2/zend_builtin_functions.c:1.239.2.3 --- ZendEngine2/zend_builtin_functions.c:1.239.2.2 Wed Jul 21 18:22:21 2004 +++ ZendEngine2/zend_builtin_functions.c Tue Aug 3 13:02:35 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_builtin_functions.c,v 1.239.2.2 2004/07/21 22:22:21 edink Exp $ */ +/* $Id: zend_builtin_functions.c,v 1.239.2.3 2004/08/03 17:02:35 helly Exp $ */ #include "zend.h" #include "zend_API.h" @@ -701,6 +701,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_CONSTANT) { + zval_update_constant(&prop_copy, 0 TSRMLS_CC); + } + add_assoc_zval(return_value, prop_name, prop_copy); } } http://cvs.php.net/co.php/ZendEngine2/tests/bug29505.phpt?r=1.1&p=1 Index: ZendEngine2/tests/bug29505.phpt +++ ZendEngine2/tests/bug29505.phpt --TEST-- Bug #29505 (get_class_vars() severely broken when used with arrays) --FILE-- <?php class Test { public $empty = array(); public $three = array(1, "b"=>"c", 3=>array()); } var_dump(get_class_vars('Test')); ?> ===DONE=== --EXPECT-- array(2) { ["empty"]=> array(0) { } ["three"]=> array(3) { [0]=> int(1) ["b"]=> string(1) "c" [3]=> array(0) { } } } ===DONE=== -- Zend Engine CVS Mailing List (http://cvs.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | cvs: ZendEngine2 /tests bug29505.phpt, Marcus Boerger |
|---|---|
| Next by Date: | cvs: ZendEngine2 / ZEND_CHANGES, Marcus Boerger |
| Previous by Thread: | cvs: ZendEngine2 /tests bug29505.phpt, Marcus Boerger |
| Next by Thread: | cvs: ZendEngine2 / ZEND_CHANGES, Marcus Boerger |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |