ID: 42014
Updated by: jani@php.net
Reported By: dustin at virtualroadside dot com
Status: Open
-Bug Type: Streams related
+Bug Type: Documentation problem
Operating System: Gentoo Linux
-PHP Version: 5.2.3
+PHP Version: 5.2.x
New Comment:
Since gzgets() is actually just a wrapper for fgets(), just using zlib
fopen wrapper, it behaves (expectectly) like fgets() does. No bug, just
documentation issue.
Previous Comments:
------------------------------------------------------------------------
[2007-07-17 02:05:18] dustin at virtualroadside dot com
Description:
------------
gzgets returns false at the end of file when reading an uncompressed
file. It does not return false when reading compressed files.
Installed:
zlib 1.2.3-r1 (gentoo)
If this is intended behavior, then the documentation should probably
have it in there.. unless I missed it. :)
Reproduce code:
---------------
$f = gzopen('somefile','r');
while(!gzeof($f))
if (($line = gzgets($f,65535)) === false)
echo "It returned false.\n";
else
echo "It did not return false!\n";
Expected result:
----------------
It did not return false!
...
It did not return false!
Actual result:
--------------
It did not return false!
...
It did not return false!
It returned false.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42014&edit=1