dimanche 5 mars 2017

PHP - Switch case evaluates to true while the same statement in if doesnt

I don't quite understands this.. Take a look at the following:

$value = 0;
if($value >= 90) {
    // this does not return true
}
switch($value) {        
    case $value >= 90:              
        // this however does
    break;  
}

Am i missing something very obvious ?

Aucun commentaire:

Enregistrer un commentaire