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