|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-06-27 12:12 UTC] tony2001@php.net
[2007-06-27 12:42 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 09 04:00:01 2025 UTC |
Description: ------------ See the code for best description, what happens... Reproduce code: --------------- class Bar extends ArrayObject { private $foo = array( 1, 2, 3 ); function __construct() { parent::__construct($this->foo); } } $foo = new Bar(); var_dump($foo); object(Bar)#1 (3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } $foo['foo'] = 23; var_dump($foo); object(Bar)#1 (4) { [0]=> int(1) [1]=> int(2) [2]=> int(3) ["foo"]=> int(23) } $bar = new Bar(); var_dump($bar); object(Bar)#2 (4) { [0]=> int(1) [1]=> int(2) [2]=> int(3) ["foo"]=> int(23) } Expected result: ---------------- The second instance should have a clean array instead of the array which the first one got.