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
This statement:
{if $r@total is odd by 2}
is compiled to:
if ((1 & $_smarty_tpl->tpl_vars['r']->total / 2)) {
which produces the warning:
E_DEPRECATED: Implicit conversion from float 7.5 to int loses precision
The text was updated successfully, but these errors were encountered:
@m-ober which Smarty version and which PHP version are you using?
Sorry, something went wrong.
PHP 8.2.1 and Smarty 4.3.0.
You can also reproduce this using {if 17 is odd by 2}{/if}.
{if 17 is odd by 2}{/if}
Looks like this deprecation was introduced with PHP 8.1: https://php.watch/versions/8.1/deprecate-implicit-conversion-incompatible-float-string.
Demo of the compiled code: https://onlinephp.io/c/7a34d
I can still reproduce this with Smarty 5.0.0-rc1 / dev-master. MWE:
<?php error_reporting(E_ALL); ini_set('display_errors', 1); require 'vendor/autoload.php'; use Smarty\Smarty; $smarty = new Smarty(); $smarty->display('string:{if 17 is odd by 2}{/if}');
No branches or pull requests
This statement:
is compiled to:
which produces the warning:
The text was updated successfully, but these errors were encountered: