Skip to content

Commit af0c225

Browse files
committed
Add test for #35895
1 parent ec36192 commit af0c225

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--TEST--
2+
Bug #35895 (__sleep and private property)
3+
--FILE--
4+
<?php
5+
class Parents {
6+
private $parents;
7+
public function __sleep() {
8+
return array("parents");
9+
}
10+
}
11+
12+
class Child extends Parents {
13+
private $child;
14+
public function __sleep() {
15+
return array_merge(array("child"), parent::__sleep());
16+
}
17+
}
18+
19+
$obj = new Child();
20+
serialize($obj);
21+
22+
?>
23+
--EXPECTF--
24+
Notice: serialize(): "parents" returned as member variable from __sleep() but does not exist in %sbug35895.php on line %d

0 commit comments

Comments
 (0)