gzgetc_basic.phpt 756 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --TEST--
  2. Test function gzgetc() by calling it with its expected arguments zlib 1.2.5
  3. --EXTENSIONS--
  4. zlib
  5. --SKIPIF--
  6. <?php
  7. include 'func.inc';
  8. if (version_compare(get_zlib_version(), '1.2.5') > 0) {
  9. die('skip - only for zlib <= 1.2.5');
  10. }
  11. ?>
  12. --FILE--
  13. <?php
  14. // note that gzgets is an alias to fgets. parameter checking tests will be
  15. // the same as gzgets
  16. $f = __DIR__."/004.txt.gz";
  17. $h = gzopen($f, 'r');
  18. $count = 0;
  19. while (gzeof($h) === false) {
  20. $count++;
  21. echo fgetc( $h );
  22. }
  23. echo "\ncharacters counted=$count\n";
  24. gzclose($h);
  25. ?>
  26. --EXPECT--
  27. When you're taught through feelings
  28. Destiny flying high above
  29. all I know is that you can realize it
  30. Destiny who cares
  31. as it turns around
  32. and I know that it descends down on me
  33. characters counted=176