summaryrefslogtreecommitdiff
path: root/ext/spl/tests/bug41692.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/spl/tests/bug41692.phpt')
-rw-r--r--ext/spl/tests/bug41692.phpt64
1 files changed, 64 insertions, 0 deletions
diff --git a/ext/spl/tests/bug41692.phpt b/ext/spl/tests/bug41692.phpt
new file mode 100644
index 0000000..c9b7d8d
--- /dev/null
+++ b/ext/spl/tests/bug41692.phpt
@@ -0,0 +1,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