|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-06-02 08:31 UTC] mike@php.net
-Status: Open
+Status: Not a bug
[2014-06-02 08:31 UTC] mike@php.net
[2014-06-02 09:03 UTC] roman4e at gmail dot com
[2014-06-02 09:12 UTC] mike@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 06:00:01 2025 UTC |
Description: ------------ php v.5.5.5 (cli) (built: Mar 17 2014 12:31:03) (DEBUG) fread() does not return error (false) on read out of file, returns "" (empty string) Test script: --------------- $f = fopen("file","r"); // file must be several KBytes size $page = 0; while ( !fseek($f,$page,SEEK_SET) ) { $page += 1024; $str = fread($f,1024); if ( $str === false ) die("error reading block"); } echo "ok" Expected result: ---------------- fread should return false Actual result: -------------- file size of 76800 result of reading out of file. last parametr is type of data returned by fread Pageoff = 75776 fseek=0 ftell=75776 read=1024 string Pageoff = 76800 fseek=0 ftell=76800 read=0 string Pageoff = 77824 fseek=0 ftell=77824 read=0 string