[SPL] ArrayObject::offsetExists

From: Date: Fri, 09 Feb 2007 10:56:51 +0000
Subject: [SPL] ArrayObject::offsetExists
Groups: php.internals 
Request: Send a blank email to internals+get-27938@lists.php.net to get a copy of this message
Hi, I am not sure whether I should post here or into php-general so feel free to bug me away ;) Anyway I have found a difference with ArrayObject::offsetExists between php 5.2.0 and php 5.2.1. With 5.2.0 ArrayObject::offsetExists will return "true" if the offsetExists whether its value is empty or not. This feature is not working anymore with 5.2.1 as it checks for the emptyness of the value too. In other words this code will throw an exception with php 5.2.1 and will work just fine with php 5.2.0: <?php $a = new ArrayObject(); $a->offsetSet('property', 0); if (!$a->offsetExists('property')) { throw new Exception('does not exists'); } echo "ok\n"; ?> Should I report it as a bug or is this a feature? Olivier

« previous php.internals (#27938) next »