dmitry          Fri Oct 21 11:19:41 2005 EDT

  Added files:                 (Branch: PHP_5_1)
    /php-src/ext/standard/tests/array   bug34934.phpt 

  Modified files:              
    /php-src    NEWS 
    /php-src/ext/standard       array.c 
  Log:
  Fixed bug #34934 (offsetExists is not called from array_key_exists)
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.2027.2.151&r2=1.2027.2.152&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.151 php-src/NEWS:1.2027.2.152
--- php-src/NEWS:1.2027.2.151   Fri Oct 21 09:22:01 2005
+++ php-src/NEWS        Fri Oct 21 11:19:37 2005
@@ -2,6 +2,7 @@
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? Oct 2005, PHP 5.1 Release Candidate 4
 - Fixed fgetcsv() and fputcsv() inconsistency. (Dmitry)
+- Fixed bug #34934 (offsetExists is not called from array_key_exists). (Dmitry)
 - Fixed bug #34905 (Digest authentication does not work with Apache 1). (Ilia)
 - Fixed bug #34902 (mysqli::character_set_name() - undefined method). (Tony)
 - Fixed bug #34893 (PHP5.1 overloading, Cannot access private property).
http://cvs.php.net/diff.php/php-src/ext/standard/array.c?r1=1.308.2.6&r2=1.308.2.7&ty=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.308.2.6 
php-src/ext/standard/array.c:1.308.2.7
--- php-src/ext/standard/array.c:1.308.2.6      Tue Oct  4 16:48:17 2005
+++ php-src/ext/standard/array.c        Fri Oct 21 11:19:39 2005
@@ -21,7 +21,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: array.c,v 1.308.2.6 2005/10/04 20:48:17 tony2001 Exp $ */
+/* $Id: array.c,v 1.308.2.7 2005/10/21 15:19:39 dmitry Exp $ */
 
 #include "php.h"
 #include "php_ini.h"
@@ -4390,6 +4390,17 @@
                RETURN_FALSE;
        }
 
+       if (Z_TYPE_PP(array) == IS_OBJECT &&
+           Z_OBJ_HT_PP(array)->has_dimension &&
+           (Z_OBJ_HT_PP(array)->has_dimension != 
std_object_handlers.has_dimension ||
+            instanceof_function_ex(Z_OBJCE_PP(array), zend_ce_arrayaccess, 1 
TSRMLS_CC))) {
+         if (Z_OBJ_HT_PP(array)->has_dimension(*array, *key, 0 TSRMLS_CC)) {
+               RETURN_TRUE;
+         } else {
+               RETURN_FALSE;
+         }
+       }
+
        switch (Z_TYPE_PP(key)) {
                case IS_STRING:
                        if (zend_symtable_exists(HASH_OF(*array), 
Z_STRVAL_PP(key), Z_STRLEN_PP(key)+1)) {

http://cvs.php.net/co.php/php-src/ext/standard/tests/array/bug34934.phpt?r=1.1&p=1
Index: php-src/ext/standard/tests/array/bug34934.phpt
+++ php-src/ext/standard/tests/array/bug34934.phpt

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

Reply via email to