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: > --- Sebastian Mendel <[email protected]> wrote: > >>Boots schrieb: >> >> >>>[...] >>>It doesn't solve the problem: the original poster was mis-using the >>>feature. >> >>:-( >> >>i dont think so! > > [..snip..] > >>$myvar = true; >> >>var_dump($myvar); >>echo '<br />'; > > >>$test = new Smarty; >>$test->assign_by_ref('myvar', $myvar); >>$test_2 = $test; >>$test_2->assign('myvar', false); >> >>var_dump($myvar); >>echo '<br />'; > > I'm suggesting that you don't really want to use assign_by_ref. i want! cause i asign an object, and later do changes in the object before rendering the output! the point is not that i dont understand what happens, that is absolutely clear to me! the point is just that it is confusing and not the way i expected it will work! but as i said before, i have no problem with this behaviour, now that im aware of it, i just would point it out. -- 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