bug35895.phpt 492 B

123456789101112131415161718192021222324
  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. class Child extends Parents {
  12. private $child;
  13. public function __sleep() {
  14. return array_merge(array("child"), parent::__sleep());
  15. }
  16. }
  17. $obj = new Child();
  18. serialize($obj);
  19. ?>
  20. --EXPECTF--
  21. Warning: serialize(): "parents" returned as member variable from __sleep() but does not exist in %s on line %d