php - Twig same as operator -
when comparing in php, advisable use === instead of == due intransitive nature , quirks "5 not number" == 5.
by guideline, mean same as operator should used instead of == in twig?:
{# "wrong" #} {% if foo.bar == 3 %} {# better #} {% if foo.bar same as(3) %} and likewise is not same as versus !=.
it makes sense when treating php , twig 2 different tools. fabien potencier's main motive creating twig provide tool web designers, not web developers. (see blog post more insight).
web developers should know more explicit , use === possible. in realm of web design perhaps not vital, if needed, feature available same as() in twig.
Comments
Post a Comment