bug43175.phpt 486 B

123456789101112131415161718192021222324
  1. --TEST--
  2. Bug #43175 (__destruct() throwing an exception with __call() causes segfault)
  3. --FILE--
  4. <?php
  5. class foobar {
  6. public function __destruct() {
  7. throw new Exception();
  8. }
  9. public function __call($m, $a) {
  10. return $this;
  11. }
  12. }
  13. function foobar() {
  14. return new foobar();
  15. }
  16. try {
  17. foobar()->unknown();
  18. } catch (Exception $e) {
  19. echo "__call via traditional factory should be caught\n";
  20. }
  21. ?>
  22. --EXPECT--
  23. __call via traditional factory should be caught