bug54323.phpt 537 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Bug #54323 (Accessing unset()'ed ArrayObject's property causes crash)
  3. --FILE--
  4. <?php
  5. class C {
  6. public $prop = 'C::prop.orig';
  7. }
  8. class MyArrayObject extends ArrayObject {
  9. }
  10. $c = new C;
  11. $ao = new MyArrayObject($c);
  12. testAccess($c, $ao);
  13. function testAccess($c, $ao) {
  14. foreach ($ao as $key=>$value) {
  15. }
  16. unset($ao['prop']);
  17. var_dump($c->prop, $ao['prop']);
  18. }
  19. ?>
  20. --EXPECTF--
  21. Warning: Undefined property: C::$prop in %s on line %d
  22. Warning: Undefined array key "prop" in %s on line %d
  23. NULL
  24. NULL