cvs: php-src(PHP_5_0) / NEWS /ext/standard array.c /ext/standard/tests/array bug29253.phpt

From: Date: Wed, 10 Aug 2005 07:43:42 +0000
Subject: cvs: php-src(PHP_5_0) / NEWS /ext/standard array.c /ext/standard/tests/array bug29253.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-33263@lists.php.net to get a copy of this message
dmitry Wed Aug 10 03:43:42 2005 EDT Added files: (Branch: PHP_5_0) /php-src/ext/standard/tests/array bug29253.phpt Modified files: /php-src NEWS /php-src/ext/standard array.c Log: Fixed bug #29253 (array_diff with $GLOBALS argument fails) http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.458&r2=1.1760.2.459&ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1760.2.458 php-src/NEWS:1.1760.2.459 --- php-src/NEWS:1.1760.2.458 Sat Aug 6 13:09:40 2005 +++ php-src/NEWS Wed Aug 10 03:43:39 2005 @@ -205,6 +205,7 @@ - Fixed bug #22836 (returning reference to uninitialized variable). (Dmitry) - Fixed bug #29689 (default value of protected member overrides default value of private) and other private variable problems in inherited classes (Stas) +- Fixed bug #29253 (array_diff with $GLOBALS argument fails). (Dmitry) - Abstract private methods are no longer allowed (Stas) 31 Mar 2005, PHP 5.0.4 http://cvs.php.net/diff.php/php-src/ext/standard/array.c?r1=1.266.2.21&r2=1.266.2.22&ty=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.266.2.21 php-src/ext/standard/array.c:1.266.2.22 --- php-src/ext/standard/array.c:1.266.2.21 Thu Aug 4 06:35:36 2005 +++ php-src/ext/standard/array.c Wed Aug 10 03:43:39 2005 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: array.c,v 1.266.2.21 2005/08/04 10:35:36 dmitry Exp $ */ +/* $Id: array.c,v 1.266.2.22 2005/08/10 07:43:39 dmitry Exp $ */ #include "php.h" #include "php_ini.h" @@ -2984,6 +2984,15 @@ /* copy the argument array */ *return_value = **args[0]; zval_copy_ctor(return_value); + if (return_value->value.ht == &EG(symbol_table)) { + HashTable *ht; + zval *tmp; + + ALLOC_HASHTABLE(ht); + zend_hash_init(ht, 0, NULL, ZVAL_PTR_DTOR, 0); + zend_hash_copy(ht, return_value->value.ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); + return_value->value.ht = ht; + } if (behavior == INTERSECT_NORMAL && data_compare_type == INTERSECT_COMP_DATA_USER) { /* array_uintersect() */ @@ -3338,6 +3347,15 @@ /* copy the argument array */ *return_value = **args[0]; zval_copy_ctor(return_value); + if (return_value->value.ht == &EG(symbol_table)) { + HashTable *ht; + zval *tmp; + + ALLOC_HASHTABLE(ht); + zend_hash_init(ht, 0, NULL, ZVAL_PTR_DTOR, 0); + zend_hash_copy(ht, return_value->value.ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *)); + return_value->value.ht = ht; + } if (behavior == DIFF_NORMAL && data_compare_type == DIFF_COMP_DATA_USER) { /* array_udiff() */ http://cvs.php.net/co.php/php-src/ext/standard/tests/array/bug29253.phpt?r=1.1&p=1 Index: php-src/ext/standard/tests/array/bug29253.phpt +++ php-src/ext/standard/tests/array/bug29253.phpt

« previous php.cvs (#33263) next »