|  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
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
 [2004-06-18 02:32 UTC] nospam0 at malkusch dot de
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');

Expected result:
bool(true) bool(false) 

Actual result:
bool(false) bool(true) 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-21 21:15 UTC]
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
Thank you for the report, and for helping us make PHP better.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 05:01:31 2024 UTC