summaryrefslogtreecommitdiff
path: root/ext/spl/tests/bug41528.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/spl/tests/bug41528.phpt')
-rw-r--r--ext/spl/tests/bug41528.phpt37
1 files changed, 37 insertions, 0 deletions
diff --git a/ext/spl/tests/bug41528.phpt b/ext/spl/tests/bug41528.phpt
new file mode 100644
index 0000000..6be82c1
--- /dev/null
+++ b/ext/spl/tests/bug41528.phpt
@@ -0,0 +1,37 @@
+--TEST--
+Bug #41528 (Classes extending ArrayObject do not serialize correctly)
+--FILE--
+<?php
+class ClassOne extends ArrayObject
+{
+ public $a = 2;
+}
+
+$classOne = new ClassOne();
+$classOne->a = 1;
+
+var_dump($classOne);
+var_dump($classOne->a);
+
+$classOne = unserialize(serialize($classOne));
+
+var_dump($classOne);
+var_dump($classOne->a);
+?>
+--EXPECT--
+object(ClassOne)#1 (2) {
+ ["a"]=>
+ int(1)
+ ["storage":"ArrayObject":private]=>
+ array(0) {
+ }
+}
+int(1)
+object(ClassOne)#2 (2) {
+ ["a"]=>
+ int(1)
+ ["storage":"ArrayObject":private]=>
+ array(0) {
+ }
+}
+int(1)