summaryrefslogtreecommitdiff
path: root/ext/spl/tests/bug70959.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/spl/tests/bug70959.phpt')
-rw-r--r--ext/spl/tests/bug70959.phpt24
1 files changed, 24 insertions, 0 deletions
diff --git a/ext/spl/tests/bug70959.phpt b/ext/spl/tests/bug70959.phpt
new file mode 100644
index 0000000000..3fd500736d
--- /dev/null
+++ b/ext/spl/tests/bug70959.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Bug #70959 (ArrayObject unserialize does not restore protected fields)
+--FILE--
+<?php
+class testObject extends ArrayObject {
+ protected $test;
+
+ public function getTest() {
+ return $this->test;
+ }
+
+ public function setTest($test) {
+ $this->test = $test;
+ }
+}
+
+$obj = new testObject();
+$obj->setTest('test');
+var_dump($obj->getTest());
+$obj2 = unserialize(serialize($obj));
+var_dump($obj2->getTest());
+--EXPECTF--
+string(4) "test"
+string(4) "test"