Quote:
Originally Posted by Gambet
According to Stefan, it's similar to how it works when you check boolean values.
This:
PHP Code:
function onCreated() { temp.bool = true; if (bool == true) { //Stuff } }
Is supposed to take longer to process than this:
PHP Code:
function onCreated() { temp.bool = true; if (bool) { //Stuff } }
|
This is, in fact, because an
if () statement is eventually evaluating down to true.
... is saying "Is
bool true?", whereas
PHP Code:
if (bool == true)
... is saying "Is
bool == true true?" (two evaluations instead of one). The difference is not huge though and it is not worth complaining about.