|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
macblack77 Smarty Rookie
Joined: 29 Mar 2016 Posts: 13
|
Posted: Wed Sep 28, 2016 9:21 am Post subject: assign v assignByRef |
|
|
noob question,
Just curious, but is assignByRef more efficient than assign?
Does smarty access the byref variables directly as opposed to taking a copy of them when you use assign? |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Wed Sep 28, 2016 10:43 am Post subject: |
|
|
Read documentation. It is only required, when you have very specific needs. Which is an exceptionally rare case in real world applications.
For all other intents and purposes, you must use Smarty::assign(). |
|
Back to top |
|
macblack77 Smarty Rookie
Joined: 29 Mar 2016 Posts: 13
|
Posted: Wed Sep 28, 2016 11:55 am Post subject: |
|
|
I read the documentation before posting and if you note I did say "just curious".
I was asking if byref was more efficient? |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
|
Back to top |
|
macblack77 Smarty Rookie
Joined: 29 Mar 2016 Posts: 13
|
Posted: Wed Sep 28, 2016 1:37 pm Post subject: |
|
|
I didn't get that?? Are you saying you agree with me?
I thought it was a perfectly valid question?
Surely there's an efficiency gain (stack/heap processing) in only passing the reference to smarty for vars as opposed to Smarty creating its own copy of each variable? |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|