dmitry          Wed Aug 10 03:43:07 2005 EDT

  Added files:                 (Branch: PHP_5_1)
    /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.2027.2.4&r2=1.2027.2.5&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.4 php-src/NEWS:1.2027.2.5
--- php-src/NEWS:1.2027.2.4     Wed Aug 10 02:37:09 2005
+++ php-src/NEWS        Wed Aug 10 03:42:48 2005
@@ -39,6 +39,7 @@
 - Fixed bug #32139 (SOAP client does not auto-handle base64 encoding). (Ilia)
 - Fixed bug #32010 (Memory leak in mssql_fetch_batch). (fmk)
 - Fixed bug #29334 (win32 mail() provides incorrect Date: header). (Jani)
+- Fixed bug #29253 (array_diff with $GLOBALS argument fails). (Dmitry)
 
 14 Jul 2005, PHP 5.1 Beta 3
 - Upgraded bundled SQLite library for PDO:SQLite to 3.2.2 (Ilia)
http://cvs.php.net/diff.php/php-src/ext/standard/array.c?r1=1.308&r2=1.308.2.1&ty=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.308 
php-src/ext/standard/array.c:1.308.2.1
--- php-src/ext/standard/array.c:1.308  Thu Aug  4 06:34:38 2005
+++ php-src/ext/standard/array.c        Wed Aug 10 03:43:06 2005
@@ -21,7 +21,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: array.c,v 1.308 2005/08/04 10:34:38 dmitry Exp $ */
+/* $Id: array.c,v 1.308.2.1 2005/08/10 07:43:06 dmitry Exp $ */
 
 #include "php.h"
 #include "php_ini.h"
@@ -3044,6 +3044,15 @@
 
        /* copy the argument array */
        RETVAL_ZVAL(*args[0], 1, 0);
+       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() */
@@ -3420,6 +3429,15 @@
 
        /* copy the argument array */
        RETVAL_ZVAL(*args[0], 1, 0);
+       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

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to