mirror of
https://github.com/php/php-src.git
synced 2024-09-23 10:57:26 +00:00
ded3d984c6
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
25 lines
457 B
PHP
25 lines
457 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"
|