note 36807 deleted from language.operators.string by betz
| From: | betz@php.net | Date: | Thu, 23 Oct 2003 10:05:39 +0000 |
| Subject: | note 36807 deleted from language.operators.string by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-59158@lists.php.net to get a copy of this message | ||
Note Submitter: drapia@hotmail.com
----
operator .= will cause memory wasting
while(1) {
$L=rand(1,500);
$a="";
for($g=0;$g<$L;$g++) {
$a.="1";
};
};
will use memory from 2684 KB to 2848 KB
however, if use $a=$a."1"; instread of $a.="1";
the memory use just 2684 KB always
This may cause memory full problem is you write a big CGI application.