bug27468.phpt 351 B

1234567891011121314151617
  1. --TEST--
  2. Bug #27468 (foreach in __destruct() causes segfault)
  3. --FILE--
  4. <?php
  5. class foo {
  6. function __destruct() {
  7. foreach ($this->x as $x);
  8. }
  9. }
  10. new foo();
  11. echo 'OK';
  12. ?>
  13. --EXPECTF--
  14. Warning: Undefined property: foo::$x in %s on line %d
  15. Warning: foreach() argument must be of type array|object, null given in %sbug27468.php on line 4
  16. OK