|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-07-01 22:04 UTC] pajoye@php.net
-Status: Open
+Status: Bogus
[2010-07-01 22:04 UTC] pajoye@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 01:00:01 2025 UTC |
Description: ------------ 2147483647 or PHP_INT_MAX on the system is the max integer. fseek fails with files over PHP_INT_MAX+2 in size. binary math would resolve the fseek issue internally. Test script: --------------- reading a file of 20 gigabytes (or anything larger then PHP_INT_MAX+2) is successful with: <?php $handle = fopen('20gbfile', 'r'); while (!feof($handle)) { echo fread($handle, PHP_INT_MAX); } fclose($handle); ?> however fseek fails: <?php $handle = fopen('20gbfile', 'r'); echo fread($handle, PHP_INT_MAX); echo fread($handle, 2); fseek($handle, -1, SEEK_CUR); echo fread($handle, 1); fclose($handle); ?> Expected result: ---------------- echo the byte from position PHP_INT_MAX+1 Actual result: -------------- crash/fail