1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/spl/tests/bug70959.phpt
Máté Kocsis 7aacc705d0 Add many missing closing PHP tags to tests
Closes GH-5958
2020-08-09 22:03:36 +02:00

26 lines
487 B
PHP

--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());
?>
--EXPECT--
string(4) "test"
string(4) "test"