gzread_basic.phpt 640 B

12345678910111213141516171819202122232425262728293031
  1. --TEST--
  2. Test function gzread() by calling it with its expected arguments
  3. --EXTENSIONS--
  4. zlib
  5. --FILE--
  6. <?php
  7. // note that gzread is an alias to fread. parameter checking tests will be
  8. // the same as fread
  9. $f = __DIR__."/004.txt.gz";
  10. $h = gzopen($f, 'r');
  11. $lengths = array(10, 14, 7, 99, 2000);
  12. foreach ($lengths as $length) {
  13. var_dump(gzread( $h, $length ) );
  14. }
  15. gzclose($h);
  16. ?>
  17. --EXPECT--
  18. string(10) "When you'r"
  19. string(14) "e taught throu"
  20. string(7) "gh feel"
  21. string(99) "ings
  22. Destiny flying high above
  23. all I know is that you can realize it
  24. Destiny who cares
  25. as it turns "
  26. string(46) "around
  27. and I know that it descends down on me
  28. "