gzopen_variation7.phpt 563 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Test function gzopen() by calling it twice on the same file and not closing one of them at the end of the script
  3. --EXTENSIONS--
  4. zlib
  5. --FILE--
  6. <?php
  7. $f = __DIR__."/004.txt.gz";
  8. $h1 = gzopen($f, 'r');
  9. $h2 = gzopen($f, 'r');
  10. var_dump(gzread($h1, 30));
  11. var_dump(gzread($h2, 10));
  12. var_dump(gzread($h1, 15));
  13. gzclose($h1);
  14. var_dump(gzread($h2, 50));
  15. // deliberately do not close $h2
  16. ?>
  17. --EXPECT--
  18. string(30) "When you're taught through fee"
  19. string(10) "When you'r"
  20. string(15) "lings
  21. Destiny f"
  22. string(50) "e taught through feelings
  23. Destiny flying high abov"