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

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -