bug35781.phpt 491 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Bug #35781 (stream_filter_append() causes segfault)
  3. --FILE--
  4. <?php
  5. $filename = __DIR__."/bug35781.txt";
  6. $fp = fopen($filename, "w");
  7. stream_filter_append($fp, "string.rot13", -49);
  8. fwrite($fp, "This is a test\n");
  9. rewind($fp);
  10. fpassthru($fp);
  11. fclose($fp);
  12. var_dump(file_get_contents($filename));
  13. @unlink($filename);
  14. echo "Done\n";
  15. ?>
  16. --EXPECTF--
  17. Notice: fpassthru(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d
  18. string(15) "Guvf vf n grfg
  19. "
  20. Done