PHP :: Bug #28822 :: ArrayObject::offsetExists() works inverted
| Bug #28822 | ArrayObject::offsetExists() works inverted | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2004-06-18 02:32 UTC | Modified: | 2004-06-21 21:15 UTC |
|
||||||||||
| From: | nospam0 at malkusch dot de | Assigned: | helly (profile) | |||||||||||
| Status: | Closed | Package: | Arrays related | |||||||||||
| PHP Version: | 5.0.0RC3 | OS: | * | |||||||||||
| Private report: | No | CVE-ID: | None | |||||||||||
[2004-06-18 02:32 UTC] nospam0 at malkusch dot de
Description:
------------
Hi
IMO offsetExists() should return true, if a key exists and
false if not. But it does it inverted.
Reproduce code:
---------------
$array = new ArrayObject();
$array->offsetSet('key', 'value');
var_dump($array->offsetExists('key'));
var_dump($array->offsetExists('nokey'));
Expected result:
----------------
bool(true) bool(false)
Actual result:
--------------
bool(false) bool(true)
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2004-06-21 21:15 UTC] helly@php.net