php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28822 ArrayObject::offsetExists() works inverted
Submitted: 2004-06-18 02:32 UTC Modified: 2004-06-21 21:15 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: nospam0 at malkusch dot de
New email:
PHP Version: OS:

 

 [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

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-21 21:15 UTC] helly@php.net
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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 20:01:28 2024 UTC