|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? 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).
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)) {
--- /dev/null
+--TEST--
+Bug #34934 (offsetExists is not called from array_key_exists)
+--FILE--
+<?php
+class MyArray extends ArrayObject {
+ function offsetExists($mKey) {
+ echo __METHOD__ . "($mKey)\n";
+ return true;
+ }
+}
+
+$a = new MyArray();
+
+var_dump(array_key_exists("test", $a));
+?>
+--EXPECT--
+MyArray::offsetExists(test)
+bool(true)