Re: [SMARTY-DEV] mixing of asign() and assign_by_ref() overwrites external vars
| From: | messju mohr | Date: | Tue, 08 Jun 2004 19:00:24 +0000 |
| Subject: | Re: [SMARTY-DEV] mixing of asign() and assign_by_ref() overwrites external vars | ||
| References: | 1 2 3 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-2417@lists.php.net to get a copy of this message | ||
On Tue, Jun 08, 2004 at 10:12:02PM +0400, Dmitry Koteroff wrote:
[...]
> $b = "xxx";
> $smarty->assign_by_ref("b", $b);
> $smarty->assign("b", "!");
> echo $b;
>
> What THEORETICALLY should print last echo statement? "!" or
> "xxx"? Whad documentation says about that (or should say)? Please
> answer.
the same semantics as
$b = "xxx";
$vb =& $b; /* assign_by_ref */
$vb = '!'; /* assign */
echo $b;
so it should print '!'.
[...]