note 103653 added to arrayobject.construct

From: Date: Tue, 26 Apr 2011 14:55:51 +0000
Subject: note 103653 added to arrayobject.construct
Groups: php.notes 
Request: Send a blank email to php-notes+get-179165@lists.php.net to get a copy of this message
@ashley at nospam dot zincdigital dot com: ArrayObject, array-object: object that behaves as an array. Seems most plausible to me. And when setting the right flag you have both array-access and property-access: <?php $test = new ArrayObject(array('1','c'=>3),ArrayObject::ARRAY_AS_PROPS); $test->a=0; $test['b']=1; var_dump((array)$test); ?> output: array(4) { [0]=> string(1) "1" ["c"]=> int(3) ["a"]=> int(0) ["b"]=> int(1) } ---- Server IP: 69.147.83.197 Probable Submitter: 212.123.7.162 ---- Manual Page -- http://www.php.net/manual/en/arrayobject.construct.php Edit -- https://master.php.net/note/edit/103653 Del: integrated -- https://master.php.net/note/delete/103653/integrated Del: useless -- https://master.php.net/note/delete/103653/useless Del: bad code -- https://master.php.net/note/delete/103653/bad+code Del: spam -- https://master.php.net/note/delete/103653/spam Del: non-english -- https://master.php.net/note/delete/103653/non-english Del: in docs -- https://master.php.net/note/delete/103653/in+docs Del: other reasons-- https://master.php.net/note/delete/103653 Reject -- https://master.php.net/note/reject/103653 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#179165) next »