|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-09-03 05:45 UTC] stas@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 11 21:00:02 2026 UTC |
I have this function build in a page: function sponsor1() { $time = time(); echo "\n<center>\n"; $bannerarray = file("bannercode.txt"); $count = count($bannerarray); for ($i = 0; $i <= count($bannerarray); $i++) { $bannerarray[($i)] = str_replace ("%random%", $time, $bannerarray[($i)]); echo $bannerarray[($i)]; } echo "\n</center>\n<br>"; } This will cause in a tremedous memory overflow (the HTTP Deamon needs all memory he can find, so the systems hangs because it's too busy with the swap-partion. But if I change something in the 'for' loop there's no problem: $printthis = str_replace ("%random%", $time, $bannerarray[($i)]); echo $printthis; This sound me like a little bug in the function 'str_replace'. When this is not fixed in later versions of PHP (I couldn't find it in the changelogs, so it must be) this bug should be there... I thought I had configured Php with one of these two : ./configure --with-mysql --with-gd=/usr/lib --with-jpeg-dir=/usr/lib --with-apache=../apache_1.3.12 --enable-track-vars ./configure --with-mysql --with-gd=../gd-1.8.2 --with-jpeg-dir=../jpeg-6b --with-apache=../apache_1.3.12 --enable-track-vars and apache with this one: ./configure --activate-module=src/modules/php4/libphp4.a --with-layout=config.layout:SuSE --enable-module=so