#41692 [Asn->Csd]: ArrayObject shows wierd behaviour in respect to inheritance
| From: | tony2001@php.net | Date: | Wed, 27 Jun 2007 12:42:32 +0000 |
| Subject: | #41692 [Asn->Csd]: ArrayObject shows wierd behaviour in respect to inheritance | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-114329@lists.php.net to get a copy of this message | ||
ID: 41692
Updated by: tony2001@php.net
Reported By: toby@php.net
-Status: Assigned
+Status: Closed
Bug Type: SPL related
Operating System: Gentoo
PHP Version: 5.2.3
Assigned To: tony2001
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2007-06-27 12:12:22] tony2001@php.net
I'll commit a patch for it in a minute..
------------------------------------------------------------------------
[2007-06-14 18:50:19] toby@php.net
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.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41692&edit=1