Fabien Potencier e2df99a9d0 feature #2966 Make the "in" operator and <,>,<=,>=,==,!= more strict when comparing strings and integers/floats (fabpot)
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
2019-04-29 19:19:57 +02:00
2019-04-27 16:57:20 +01:00
2019-04-23 16:33:38 +02:00
2019-04-24 16:59:53 +02:00

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
Languages
PHP 99.9%