Mantis - Quercus
Viewing Issue Advanced Details
2404 major always 02-06-08 06:13 02-06-08 22:20
lee_saferite  
nam  
normal  
closed 3.1.5  
fixed  
none    
none 3.1.5  
0002404: array_key_exists does not work with ArrayObject
array_key_exists does not work correctly with ArrayObject variables but does work with normal array variables.
Code:
$one = new ArrayObject();
$one['one'] = "one here";
$two = array();
$two['two'] = 2;

var_dump($one->offsetExists('one'));
var_dump(isset($one['one']));
var_dump(array_key_exists('one', $one));
var_dump($one->offsetExists('not_here'));
var_dump(isset($one['not_here']));
var_dump(array_key_exists('not_here', $one));

var_dump(isset($two['two']));
var_dump(array_key_exists('two', $two));
var_dump(isset($two['not_here']));
var_dump(array_key_exists('not_here', $two));

Expected Result:
bool(true)
bool(true)
bool(true)
bool(false)
bool(false)
bool(false)
bool(true)
bool(true)
bool(false)
bool(false)

Actual Result:
bool(true)
bool(true)
bool(false)
bool(false)
bool(false)
bool(false)
bool(true)
bool(true)
bool(false)
bool(false)

Notes
(0002724)
lee_saferite   
02-06-08 06:22   
This issue is present in:

resin-pro-3.1.s080205
resin-pro-3.1.s080130
resin-pro-3.1.4a
(0002728)
nam   
02-06-08 22:20   
php/4a4r