Years ago, I have been told that tests should be built as a funnel : complexity has to grow from left to right (to improve performance I think).
For instance, if ($a == '1')
would be better if written if ('1' == $a)
, because $a complexity is unknown while '1' is low.
Now I don't remember exactly why this rule exists and can't find anything about it since I can't really express it, apart from this page which is a bit shady.
Is this a real thing ? And if so, why ? Please and thank you :)