bug63066.phpt 425 B

123456789101112131415161718192021
  1. --TEST--
  2. Bug #63066 (Calling an undefined method in a generator results in a seg fault)
  3. --FILE--
  4. <?php
  5. function gen($o)
  6. {
  7. yield 'foo';
  8. $o->fatalError();
  9. }
  10. foreach(gen(new stdClass()) as $value)
  11. echo $value, "\n";
  12. ?>
  13. --EXPECTF--
  14. foo
  15. Fatal error: Uncaught Error: Call to undefined method stdClass::fatalError() in %s:%d
  16. Stack trace:
  17. #0 %s(%d): gen(Object(stdClass))
  18. #1 {main}
  19. thrown in %sbug63066.php on line 5