On Thu, Mar 15, 2012 at 3:21 PM, Klaus Silveira <klaussilve...@php.net> wrote: > Hello internals, > > I've been involved in a discussion at the PHP Standards Group and we > recently had the following statement: > > *Say you had a loop, and inside that loop you wanted to modify a param >> **update the key:** >> **foreach($a as $key => $val) { >> ** $a[$key] = someLong(functionCalls(hereThat($spanOver85Chars))); >> **}** >> **If this exceeded the line width, you would have to split things like >> **this over a few lines, storing the val temporarily in a zval's until >> **you reached your end computation. Therefore allocating more memory >> **iteratively. * If I am understanding the text correctly it is saying that $f1 = f1(); $f2 = f2($f1); $f3 = f3($f2); is using more memory than $f3 = f3(f2(f1()));
For me this doesn't make any sense. In the latter case PHP will also create temporary variables to store the return values. There should be no difference in memory consumption. Nikita -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php