iliaa           Sun Jul 11 11:23:57 2004 EDT

  Modified files:              
    /php-src    NEWS 
    /php-src/ext/standard       array.c 
  Log:
  Fixed bug #29008 (array_combine() does not handle non-numeric/string keys).
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1754&r2=1.1755&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1754 php-src/NEWS:1.1755
--- php-src/NEWS:1.1754 Tue Jul  6 03:30:31 2004
+++ php-src/NEWS        Sun Jul 11 11:23:56 2004
@@ -5,6 +5,8 @@
 - Updated PCRE to provide better error handling in certain cases. (Andrei)
 - Changed doc comments to require a single white space after '/**'. (Marcus)
 - Fixed bug #29019 (Database not closing). (Marcus)
+- Fixed bug #29008 (array_combine() does not handle non-numeric/string keys).
+  (Ilia)
 - Fixed bug #28895 (ReflectionClass::isAbstract always returns false). (Marcus)
 - Fixed bug #28868 (Internal filter registry not thread safe). (Sara)
 - Fixed bug #28851 (call_user_func_array has typo in error message). (Marcus)
http://cvs.php.net/diff.php/php-src/ext/standard/array.c?r1=1.262&r2=1.263&ty=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.262 php-src/ext/standard/array.c:1.263
--- php-src/ext/standard/array.c:1.262  Thu Jul  8 13:07:22 2004
+++ php-src/ext/standard/array.c        Sun Jul 11 11:23:57 2004
@@ -21,7 +21,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: array.c,v 1.262 2004/07/08 17:07:22 iliaa Exp $ */
+/* $Id: array.c,v 1.263 2004/07/11 15:23:57 iliaa Exp $ */
 
 #include "php.h"
 #include "php_ini.h"
@@ -4246,6 +4246,17 @@
                } else if (Z_TYPE_PP(entry_keys) == IS_LONG) {
                        zval_add_ref(entry_values);
                        add_index_zval(return_value, Z_LVAL_PP(entry_keys), 
*entry_values);
+               } else {
+                       zval key;
+
+                       key = **entry_keys;
+                       zval_copy_ctor(&key);
+                       convert_to_string(&key);
+
+                       zval_add_ref(entry_values);
+                       add_assoc_zval(return_value, Z_STRVAL(key), *entry_values);
+
+                       zval_dtor(&key);
                }
                zend_hash_move_forward_ex(Z_ARRVAL_P(keys), &pos_keys);
                zend_hash_move_forward_ex(Z_ARRVAL_P(values), &pos_values);

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

Reply via email to