bug41421.phpt 604 B

1234567891011121314151617181920212223242526272829
  1. --TEST--
  2. Bug #41421 (Uncaught exception from a stream wrapper segfaults)
  3. --FILE--
  4. <?php
  5. class wrapper {
  6. function stream_open() {
  7. return true;
  8. }
  9. function stream_eof() {
  10. throw new exception();
  11. }
  12. }
  13. stream_wrapper_register("wrap", "wrapper");
  14. $fp = fopen("wrap://...", "r");
  15. feof($fp);
  16. echo "Done\n";
  17. ?>
  18. --EXPECTF--
  19. Warning: feof(): wrapper::stream_eof is not implemented! Assuming EOF in %s on line %d
  20. Fatal error: Uncaught Exception in %s:%d
  21. Stack trace:
  22. #0 [internal function]: wrapper->stream_eof()
  23. #1 %s(%d): feof(Resource id #%d)
  24. #2 {main}
  25. thrown in %s on line %d