gzgetc_basic_1.phpt 795 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. --TEST--
  2. Test function gzgetc() by calling it with its expected arguments zlib 1.2.7
  3. --EXTENSIONS--
  4. zlib
  5. --SKIPIF--
  6. <?php
  7. include 'func.inc';
  8. if (version_compare(get_zlib_version(), '1.2.7') < 0) {
  9. die('skip - only for zlib >= 1.2.7');
  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. if ($h) {
  19. $count = 0;
  20. while (($c = fgetc( $h )) !== false) {
  21. $count++;
  22. echo $c;
  23. }
  24. echo "\ncharacters counted=$count\n";
  25. gzclose($h);
  26. }
  27. ?>
  28. --EXPECT--
  29. When you're taught through feelings
  30. Destiny flying high above
  31. all I know is that you can realize it
  32. Destiny who cares
  33. as it turns around
  34. and I know that it descends down on me
  35. characters counted=176