note 124924 added to function.feof

From: Date: Fri, 17 Apr 2020 13:09:39 +0000
Subject: note 124924 added to function.feof
Groups: php.notes 
Request: Send a blank email to php-notes+get-214491@lists.php.net to get a copy of this message
The manual above is misleading: "Returns TRUE if the file pointer is at EOF or an error occurs (including socket timeout); otherwise returns FALSE." feof(-1) is certainly some form of an error (wrong parameters). But: <?php if (feof(-1)===FALSE) echo "wrong!"; else echo "ok"; if (feof(-1)===TRUE) echo "ok"; else echo "wrong!"; ?> outputs "wrong!wrong!" So the documentation should better read: "Returns TRUE if EOF has been previously detected on the file pointer (this includes errors like a socket timeout); In all other cases it returns FALSE (this includes all other types of errors). ---- Server IP: 45.112.84.4 Probable Submitter: 103.51.167.36 (proxied: 178.27.105.10) ---- Manual Page -- http://php.net/manual/en/function.feof.php Edit -- https://master.php.net/note/edit/124924 Del: integrated -- https://master.php.net/note/delete/124924/integrated Del: useless -- https://master.php.net/note/delete/124924/useless Del: bad code -- https://master.php.net/note/delete/124924/bad+code Del: spam -- https://master.php.net/note/delete/124924/spam Del: non-english -- https://master.php.net/note/delete/124924/non-english Del: in docs -- https://master.php.net/note/delete/124924/in+docs Del: other reasons-- https://master.php.net/note/delete/124924 Reject -- https://master.php.net/note/reject/124924 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#214491) next »