We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
With the change to 3.1.30 the array_shift will be executed twice:
{$array = [1, 2]} {if $value = array_shift($array)} Count: {count($array)} {/if}
This will output 0 instead of 1.
The generated code looks something like this:
$_smarty_tpl->_assignInScope('array', array(1,2)); $_smarty_tpl->_assignInScope('value', array_shift($_smarty_tpl->tpl_vars['array']->value)); if (array_shift($_smarty_tpl->tpl_vars['array']->value)) {?>Count: <?php echo Vierwd\VierwdSmarty\View\clean(count($_smarty_tpl->tpl_vars['array']->value),$_smarty_tpl); }
Version 3.1.29 worked fine and generated this code:
$_smarty_tpl->tpl_vars['array'] = new Smarty_Variable(array(1,2), null); $_smarty_tpl->ext->_updateScope->updateScope($_smarty_tpl, 'array', 0); if (!isset($_smarty_tpl->tpl_vars['value'])) $_smarty_tpl->tpl_vars['value'] = new Smarty_Variable(null);if ($_smarty_tpl->tpl_vars['value']->value = array_shift($_smarty_tpl->tpl_vars['array']->value)) {?>Count: <?php echo Vierwd\VierwdSmarty\View\clean(smir(count($_smarty_tpl->tpl_vars['array']->value)),$_smarty_tpl); }
The text was updated successfully, but these errors were encountered:
- bugfix assigning a variable in if condition by function like {if $v…
424dca6
…alue = array_shift($array)} the function got called twice #291
This is now fixed in the master branch.
Sorry, something went wrong.
cd28347
No branches or pull requests
With the change to 3.1.30 the array_shift will be executed twice:
This will output 0 instead of 1.
The generated code looks something like this:
Version 3.1.29 worked fine and generated this code:
The text was updated successfully, but these errors were encountered: