Re: mixing of asign() and assign_by_ref() overwrites external vars

From: Date: Fri, 04 Jun 2004 14:20:55 +0000
Subject: Re: mixing of asign() and assign_by_ref() overwrites external vars
References: 1 2  Groups: php.smarty.dev php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-2390@lists.php.net to get a copy of this message
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

« previous php.smarty.dev (#2390) next »