#19970 [Com]: feof()/fgets()/fgetcsv() problem

From: Date: Fri, 18 Oct 2002 08:45:31 +0000
Subject: #19970 [Com]: feof()/fgets()/fgetcsv() problem
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-22745@lists.php.net to get a copy of this message
ID: 19970 Comment by: michael.mauch@gmx.de Reported By: cynic@php.net 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] cynic@php.net 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

« previous php.bugs (#22745) next »