mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-13 02:46:29 +00:00
e2df99a9d09f5adc288f3514753201a19b0eaa08
This PR was merged into the 3.x branch.
Discussion
----------
Make the "in" operator and <,>,<=,>=,==,!= more strict when comparing strings and integers/floats
The PHP non-strict comparison operator has some counter-intuitive behaviors, which we inherit in Twig. For instance, `{{ 'text' in [0] }}` returns `true`.
PHP is probably going to fix it in version 8: https://wiki.php.net/rfc/string_to_number_comparison
I propose to implement the same semantics in Twig for 3.0.
closes #2824, closes #341, closes #340
Commits
-------
58923b09 made the in, <, >, <=, >=, ==, and != operators more strict when comparing strings and integers/floats
…
Twig, the flexible, fast, and secure template language for PHP ============================================================== Twig is a template language for PHP, released under the new BSD license (code and documentation). Twig uses a syntax similar to the Django and Jinja template languages which inspired the Twig runtime environment. More Information ---------------- Read the `documentation`_ for more information. .. _documentation: https://twig.symfony.com/documentation
Description
Languages
PHP
99.9%