bug75776.phpt 564 B

12345678910111213141516171819202122
  1. --TEST--
  2. Bug #75776 (Flushing streams with compression filter is broken)
  3. --EXTENSIONS--
  4. bz2
  5. --FILE--
  6. <?php
  7. $text = str_repeat('0123456789abcdef', 1000);
  8. $temp = fopen('php://temp', 'r+');
  9. stream_filter_append($temp, 'bzip2.compress', STREAM_FILTER_WRITE);
  10. fwrite($temp, $text);
  11. rewind($temp);
  12. var_dump(bin2hex(stream_get_contents($temp)));
  13. var_dump(ftell($temp));
  14. fclose($temp);
  15. ?>
  16. --EXPECT--
  17. string(144) "425a68343141592653599fe7bbbf0001f389007fe03f002000902980026826aa80003ea9061520c6a41954833a9069520d6a41b54837a9071520e6a41d5483ba9079520f6a41f548"
  18. int(72)