When comparing in PHP, it is advisable to use ===
instead of ==
due to intransitive nature and quirks like "5 is not a number" == 5
.
By that guideline, does it mean that the same as
operator should be used instead of ==
in Twig?:
{# "Wrong" #}
{% if foo.bar == 3 %}
{# Better #}
{% if foo.bar is same as(3) %}
And likewise for is not same as
versus !=
.