Stack Memory Error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alex

    Stack Memory Error

    In 2 web hostings (hostinggratisa rgentina.com and
    granjadeservido res.com), both using PHP 4.3 ( .9 and .10 respectively),
    I get the strangest error:

    Apparently, after using too much space in local variables, php just
    uses the same memory space for the variables, assignment stops working,
    and, well, everything fails.

    function renderEcho() {

    $x[0]=22;

    if ($x[0]!=22) {echo 'DIFFERENT!'; debug_zval_dump ($x);} else
    'EQUAL!!';

    [...]
    foreach (array_keys($th is->childNodes) as $k) {
    $this->childNodes[$k]->renderEcho() ;
    }
    }

    Here's some output:

    DIFFERENT!strin g(5) "2alue" refcount(3) DIFFERENT!strin g(5) "2alue"
    refcount(3)
    Warning: Cannot use a scalar value as an array in .../XMLNode.class.p hp
    on line 100 (the assignment)
    DIFFERENT!NULL refcount(1)

    As you can see, sometimes it has a string, (which I think it should be
    "value"), later it has NULL, and it never has an array.

    I removed some temporary variables in someplaces and I got my script to
    go further, but it still fails.

    This problem does not exist in my ubuntu edgy PC (PHP 4.4.2-1.1). Any
    ideas how to solve this?

  • Alex

    #2
    Re: Stack Memory Error



    On Jan 10, 1:29 pm, "Alex" <alexsi...@gmai l.comwrote:
    In 2 web hostings (hostinggratisa rgentina.com and
    granjadeservido res.com), both using PHP 4.3 ( .9 and .10 respectively),
    I get the strangest error:
    Well, apparently the problem was misuse of references in PHP 4.3. Using
    PHP 4.4, I found all of the "Notice: Only variable references should be
    returned by reference" in my code and that solved it.

    Comment

    Working...