[dev] Templates: conditions in arrays (correction)

Nuno Loureiro nuno at co.sapo.pt
Sat Sep 13 11:24:03 PDT 2003


On Fri, 2003-09-12 at 16:44, Chuck Hagenbuch wrote:
> Quoting Nuno Loureiro <nuno at co.sapo.pt>:
> 
> > *nod*. I just did it that way, because the single conditions were
> > already that way in this class. I thought it was because of memory usage
> > issues.
> 
> Although, we're already storing the array in $this->_arrays. So if we also
> assign $var to $this->_ifs, PHP's reference counting should ensure that we use
> no more memory than we are already using.
> 
> I'm gonna try taking it out; let me know if you disagree.

Good. Yes, I agree.. Just didn't know that behavour... 
We're always learning! :)

In attach you can find a patch to fix 2 bugs:

- elses were not working in arrays
- this is kind of hard do explain, but it was only parsing ifs in arrays
once, so the first array element ruled for the whole loop. It's probably
easier to look to the code to understand..

nuno

-- 
Nuno Loureiro <nuno at co.sapo.pt>
PTM.com - http://www.sapo.pt/
PGP fingerprint = 8A32 5174 E80C 2D40 9075 405E C107 6592 054A 4D05
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tpl.diff
Type: text/x-patch
Size: 3004 bytes
Desc: not available
Url : http://lists.horde.org/archives/dev/attachments/20030913/78593a9f/tpl.bin


More information about the dev mailing list