lundi 24 août 2015

Is IF(integer) valid in PHP? [duplicate]

This question already has an answer here:

I'm working through updating this PHP based website and I've noticed that there are a lot of these statements like

IF(foo['bar']){
    //Foo your Bars here
}

For this rudimentary example, my analysis indicated that the value stored at foo['bar'] is an integer.

I distinctly remember learning in school that value != 0 translates to TRUE when performing a boolean test - does this hold true in PHP as well?

Aucun commentaire:

Enregistrer un commentaire