note 74370 rejected from function.fpassthru by bjori
| From: | bjori@php.net | Date: | Sun, 08 Apr 2007 08:12:22 +0000 |
| Subject: | note 74370 rejected from function.fpassthru by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-125190@lists.php.net to get a copy of this message | ||
Note Submitter: public at telcontar dot net
----
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.