note 110399 added to function.file-get-contents
| From: | Anonymous | Date: | Thu, 18 Oct 2012 11:37:59 +0000 |
| Subject: | note 110399 added to function.file-get-contents | ||
| Groups: | php.notes php.notes | ||
| Request: | Send a blank email to php-notes+get-191420@lists.php.net to get a copy of this message | ||
file_get_contents tries to read the whole file into memory, even when using the offset parameter.
For example, trying to read a few bytes from the end of the file:
$x=file_get_contents('test',false,NULL,1670888815);
Results in :
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 1670897009 bytes)
in /var/www/test/t.php on line 2
----
Server IP: 195.221.21.36
Probable Submitter: 82.224.205.171
----
Manual Page -- http://www.php.net/manual/en/function.file-get-contents.php
Edit -- https://master.php.net/note/edit/110399
Del: integrated -- https://master.php.net/note/delete/110399/integrated
Del: useless -- https://master.php.net/note/delete/110399/useless
Del: bad code -- https://master.php.net/note/delete/110399/bad+code
Del: spam -- https://master.php.net/note/delete/110399/spam
Del: non-english -- https://master.php.net/note/delete/110399/non-english
Del: in docs -- https://master.php.net/note/delete/110399/in+docs
Del: other reasons-- https://master.php.net/note/delete/110399
Reject -- https://master.php.net/note/reject/110399
Search -- https://master.php.net/manage/user-notes.php