hier nochmal das script und unten das ergebnis auf meinem server.
habe festgestellt, dass das nicht auf jedem server so ist.
fall jemand weiß, welche einstellung schuld daran hat -> bitte bescheid sagen: garbage collector memory limit hab ich mir sagen lassen. aber ka, wie mans umstellt...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?
    $testa = array();
    $testa[]='aaaaaaaaaaaaaaaaaaaaaaaaa';
    $testa[]='bbbbbbbbbbbbbbbbbbbbbbbbb';
    $testa[]='ccccccccccccccccccccccccc';
    $testa[]='aaaaaaaaaaaaaaaaaaaaaaaaa';
    $testa[]='bbbbbbbbbbbbbbbbbbbbbbbbb';
    $testa[]='ccccccccccccccccccccccccc';
    $testa[]='aaaaaaaaaaaaaaaaaaaaaaaaa';
    $testa[]='bbbbbbbbbbbbbbbbbbbbbbbbb';
    $testa[]='ccccccccccccccccccccccccc';
    $testa[]='aaaaaaaaaaaaaaaaaaaaaaaaa';
    $testa[]='bbbbbbbbbbbbbbbbbbbbbbbbb';
    $testa[]='ccccccccccccccccccccccccc';
    echo memory_get_usage()."<- memory usage before starting loop with limit at: ".ini_get('memory_limit')."<br>";flush();
    for($i=0;$i<4;$i++)
    {
    $tstart = microtime(true);
    for($j=0;$j<100000;$j++)
        $testa=str_replace('_aaa','bbb',$testa);
    echo microtime(true)-$tstart.' -memory usage: '.memory_get_usage()."<br>";flush();
    flush();
    }
?>
16432<- memory usage before starting loop with limit at: 8M
-0.089416 -memory usage: 36480
0.497955 -memory usage: 36480
-0.508495 -memory usage: 36480
0.493202 -memory usage: 36480
 nicht angemeldet
 nicht angemeldet Auge
 Auge seth
 seth