note 114509 added to class.arrayobject

From: Date: Sun, 02 Mar 2014 01:46:29 +0000
Subject: note 114509 added to class.arrayobject
Groups: php.notes 
Request: Send a blank email to php-notes+get-198755@lists.php.net to get a copy of this message
Beware that foreach($arrayObject) will skip NULL keys! Test: <?php $o = new ArrayObject(array(NULL => 'NULL', 1, 2)); foreach ($o as $key => $i) { echo $key, '=', $i, "\n"; } foreach ((array)$o as $key => $i) { echo $key, '=', $i, "\n"; } ?> I have expected the output to match, but this is what I get: 0=1 1=2 =NULL 0=1 1=2 Notice that NULL key is missing. ---- Server IP: 72.52.91.14 Probable Submitter: 72.52.91.14 ---- Manual Page -- http://php.net/manual/en/class.arrayobject.php Edit -- https://master.php.net/note/edit/114509 Del: integrated -- https://master.php.net/note/delete/114509/integrated Del: useless -- https://master.php.net/note/delete/114509/useless Del: bad code -- https://master.php.net/note/delete/114509/bad+code Del: spam -- https://master.php.net/note/delete/114509/spam Del: non-english -- https://master.php.net/note/delete/114509/non-english Del: in docs -- https://master.php.net/note/delete/114509/in+docs Del: other reasons-- https://master.php.net/note/delete/114509 Reject -- https://master.php.net/note/reject/114509 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#198755) next »