1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
--TEST--
Bug #41692 (ArrayObject shows weird behaviour in respect to inheritance)
--FILE--
<?php
class Bar extends ArrayObject {
private $foo = array( 1, 2, 3 );
function __construct()
{
parent::__construct($this->foo);
}
}
$foo = new Bar();
var_dump($foo);
$foo['foo'] = 23;
$bar = new Bar();
var_dump($bar);
echo "Done\n";
?>
--EXPECTF--
object(Bar)#%d (2) {
["foo":"Bar":private]=>
array(3) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
}
["storage":"ArrayObject":private]=>
array(3) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
}
}
object(Bar)#%d (2) {
["foo":"Bar":private]=>
array(3) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
}
["storage":"ArrayObject":private]=>
array(3) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
}
}
Done
|