ID:               19970
 Comment by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Open
 Bug Type:         Filesystem function related
 Operating System: FreeBSD 4.7-STABLE
 PHP Version:      4.2.2
 New Comment:

I get bool(true) with 4.2.3 and 4.3.0-dev (from yesterday), both
mod_php, Linux 2.4.19.

Maybe it's a documentation problem:

the manual only says about the return value of fgets():

  If an error occurs, returns FALSE.

Nothing is said about the return value on EOF (only "People used to the
'C' semantics of fgets()  should note the difference in how EOF is
returned."), so I guess fgets() is free to return whatever it likes on
EOF. Was this different in previous versions of PHP?


Previous Comments:
------------------------------------------------------------------------

[2002-10-18 01:57:06] [EMAIL PROTECTED]

am I the only one who thinks that this should not output anything?

<?php
$fd = fopen(__FILE__, 'r');
while (!feof($fd)) fgets($fd, 4096) || var_dump(feof($fd));
fclose($fd);

I get bool(false) from 4.4.0-dev (cli) and 4.2.2 mod_php.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=19970&edit=1

Reply via email to