lundi 5 janvier 2015

Advantage of "condition == $variable" style? [duplicate]


I often see if's like:



if (null === $var)


I wanted to know wether there is any technical advantage by using it?


I find it semantically wrong and I don't like it. Prefer



if ($var === null)


because I ask for the condition of a variable, not for a variable having a condition.


Aucun commentaire:

Enregistrer un commentaire