#28822 [NEW]: ArrayObject::offsetExists() works inverted

From: Date: Fri, 18 Jun 2004 00:32:45 +0000
Subject: #28822 [NEW]: ArrayObject::offsetExists() works inverted
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-61048@lists.php.net to get a copy of this message
From: nospam0 at malkusch dot de Operating system: Linux PHP version: 5.0.0RC3 PHP Bug Type: Arrays related Bug description: ArrayObject::offsetExists() works inverted 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 bug report at http://bugs.php.net/?id=28822&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28822&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28822&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=28822&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=28822&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=28822&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=28822&r=needscript Try newer version: http://bugs.php.net/fix.php?id=28822&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=28822&r=support Expected behavior: http://bugs.php.net/fix.php?id=28822&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=28822&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=28822&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=28822&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28822&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=28822&r=dst IIS Stability: http://bugs.php.net/fix.php?id=28822&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=28822&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=28822&r=float

« previous php.bugs (#61048) next »