ID: 28831 Updated by: [EMAIL PROTECTED] Reported By: nospam0 at malkusch dot de -Status: Open +Status: Bogus Bug Type: Arrays related Operating System: Linux PHP Version: 5CVS-2004-06-18 (dev) New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Unfortunatley internal functions cannot return a reference....... Try this code: <?php $array = new ArrayObject(); $subArray = new ArrayObject(); $array->append($subArray); $subArray->append('item'); var_dump($array); $x=$array->offsetGet(0); $x->append('item2'); var_dump($array); var_dump($x); ?> Previous Comments: ------------------------------------------------------------------------ [2004-06-18 16:19:13] nospam0 at malkusch dot de Description: ------------ If I save an ArrayObject in an ArrayObject, I can't manipulate the stored ArrayObject, by getting it with offsetGet() Reproduce code: --------------- $array = new ArrayObject(); $subArray = new ArrayObject(); $array->append($subArray); $subArray->append('item'); var_dump($array); $array->offsetGet(0)->append('item2'); var_dump($array); Expected result: ---------------- object(ArrayObject)#23 (1) { [0]=> object(ArrayObject)#24 (1) { [0]=> string(4) "item" } } oobject(ArrayObject)#23 (1) { [0]=> object(ArrayObject)#24 (1) { [0]=> string(4) "item", [1]=> string(5) "item2" } } Actual result: -------------- object(ArrayObject)#23 (1) { [0]=> object(ArrayObject)#24 (1) { [0]=> string(4) "item" } } object(ArrayObject)#23 (1) { [0]=> NULL } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28831&edit=1
