Re: [SMARTY] assign_by_ref better than assign?
| From: | messju mohr | Date: | Sun, 10 Aug 2003 08:19:27 +0000 |
| Subject: | Re: [SMARTY] assign_by_ref better than assign? | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-10027@lists.php.net to get a copy of this message | ||
On Sun, Aug 10, 2003 at 12:41:11AM -0400, John W. Holmes wrote:
> Hi. I just noticed the assign_by_ref() method. I usually build up a
> large $input array that's passed to smarty to display everything with
> {$input.key}. Am I correct in assuming that things will be faster and
> less memory intensive by using assign_by_ref() instead of assign()?
only if you modify the array after you assigned it.
> Are
> there any pitfalls I should be watching for by using assign_by_ref()?
as with references in php in genereal: yes, many. :)
honestly: if you know what you do and you know what references are and
if you can tell the difference between assign() and assign_by_ref() by
heart and if you know on each line of your code which one you used
before for the variable in question, there are no real pitfalls that
are not publically known.
> Thanks.
>
> --
> ---John Holmes...