note 74373 added to function.fpassthru
| From: | public at telcontar dot net | Date: | Sun, 08 Apr 2007 08:26:54 +0000 |
| Subject: | note 74373 added to function.fpassthru | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-125193@lists.php.net to get a copy of this message | ||
(Do not delete this, it is NOT a bug report. It is a *follow up* to vague comments on the page about
fpassthru() using excessive memory, and a usage tip that if you want to use pass-through processing,
PHP 5 is strongly advised. It may LOOK like a bug report because unlike earlier tips, I've
tried to clarify the situation. It is not a bug report because the problem is RESOLVED in PHP 5.
Rather, anyone still using PHP 4 (for example, for compatibility reasons) should simply be aware
that the problem is now resolved.)
In PHP 4 (4.4.4 tested as a CGI, Apache 2, Linux), use of both fpassthru() and fread() in a loop
suffer the SAME memory "leakage". This is characterised by all data that is sent to the
client also being kept inside PHP and not released. It would appear to be a failure to garbage
collect the data.
In PHP 5 (5.2.1 tested as a CGI, Apache 2, Linux) this flaw is resolved in both cases. Neither
fpassthru() nor fread() in a loop "leak" memory during execution.
The issue of which one to use appears not to be an issue of memory as both were equally flawed in
PHP 4 and both are equally fixed in PHP 5.
Speed, is left to a reader exercise to test in the latest PHPs.
----
Server IP: 194.145.210.4
Probable Submitter: 82.28.36.206
----
Manual Page -- http://www.php.net/manual/en/function.fpassthru.php
Edit -- https://master.php.net/note/edit/74373
Del: integrated -- https://master.php.net/note/delete/74373/integrated
Del: useless -- https://master.php.net/note/delete/74373/useless
Del: bad code -- https://master.php.net/note/delete/74373/bad+code
Del: spam -- https://master.php.net/note/delete/74373/spam
Del: non-english -- https://master.php.net/note/delete/74373/non-english
Del: in docs -- https://master.php.net/note/delete/74373/in+docs
Del: other reasons-- https://master.php.net/note/delete/74373
Reject -- https://master.php.net/note/reject/74373
Search -- https://master.php.net/manage/user-notes.php