Re: Re[2]: [SMARTY-DEV] Re[2]: mixing of asign() and assign_by_ref() overwrites external vars
| From: | boots | Date: | Fri, 04 Jun 2004 19:11:42 +0000 |
| Subject: | Re: Re[2]: [SMARTY-DEV] Re[2]: mixing of asign() and assign_by_ref() overwrites external vars | ||
| References: | 1 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-2398@lists.php.net to get a copy of this message | ||
--- Dmitry Koteroff <delete@koteroff.ru> wrote:
> B> Another example of breaking BC without adding anything new...
> It is not "breaking". It is adding new feature without changing
> existing behaviour (apropos, undocumented behaviour).
It is not a new feature, assigning by ref facilities are already
provided by Smarty.
> (What is BC? "Before Christ"? Or, maybe, "Bachelor of Commerce"?)
Hmmm. have you heard of the term Backwards Compatible? FWIW, "Bachelor
of Commerce" is usually denoted B.Com.
> Seems I know why are you so afraid to modify existing core. The
> reason is good and noble - you are afraid of new possible bugs.
> But everything has its measure.
You are right about that -- conversely, I'm getting the idea that you
are too ready to modify the core without considering how others might
be using it :)
This breaks BC because it changes the way assign works. In particular,
what if someone is currently doing something like this:
$a = "b";
$b =& $a;
$smarty->assign('b', $b);
So now in template {$b} == "b". However, if from a plugin:
global $a;
$a = "c";
With your patch, the in-template result is that now {$b} == "c" and
this is *not* the currently expected result in Smarty.
You can say what you want about the value of that usage pattern -- the
point is, you can't predict if people are using it or not (and there
are other ways to invoke that scenario).
Sorry if I sounded too abrupt before -- I realize you are trying to add
value and I should have taken the time to provide a more thorough
comment to your proposal instead of dashing out a one-liner as I did.
Best Regards,
xo boots
__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/