Re: mixing of asign() and assign_by_ref() overwrites external vars
Sebastian Mendel <[email protected]>
| Newsgroups | gmane.comp.php.smarty.devel |
|---|---|
| Message-ID | <[email protected]> |
Boots schrieb:
>>>>$testvar = true;
>>>>$smarty = new Smarty;
>>>>
>>>>$smarty->assign_by_ref('testvar', $testvar);
>>>>
>>>>// bug?
>>>>var_dump($testvar); // prints: (bool) true
>>>>$smarty->assign('testvar', false);
>>>>var_dump($testvar); // prints: (bool) false
>>>
>>>What do you think should happen? You are changing a by-reference
>>>value
>>
>>i expect if i use appand() that the reference is unset by smarty,
>>cause
>>i dont think that any body wants to set an external var this way!
>
> I suspect you don't really want to use append_by_ref then.
of course, i could, and this all is not really a problem for me,
its just that this is not what i expected!
if i assign a var by reference to smarty, than cause i want to make
changes to this var after i append it to smarty, or to save resources
but never to overwrite this extern var by a call to append()
if others think this is not a bug ... not my problem! as i said i have
no problem with this behavior
p.s. sorry for my english
--
Sebastian Mendel
www.sebastianmendel.de www.warzonez.de www.tekkno4u.de www.nofetish.com
www.sf.net/projects/phpdatetime www.sf.net/projects/phptimesheet
--
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php