#28822 [Opn->Csd]: ArrayObject::offsetExists() works inverted
| From: | helly@php.net | Date: | Mon, 21 Jun 2004 19:16:03 +0000 |
| Subject: | #28822 [Opn->Csd]: ArrayObject::offsetExists() works inverted | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-61173@lists.php.net to get a copy of this message | ||
ID: 28822
Updated by: helly@php.net
Reported By: nospam0 at malkusch dot de
-Status: Open
+Status: Closed
Bug Type: Arrays related
Operating System: *
PHP Version: 5.0.0RC3
Assigned To: helly
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2004-06-18 02:32:44] 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)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=28822&edit=1