I have a piece of code. It is returning false every time, despite the fact that condition is true. Where am I wrong?
$a = 5;
$b = 10;
$c = 15;
if( ($c > $b) > $a){
echo "yes";
} else {
echo "no";
}
For your data
($c > $b)
is true
.
true > $a
is false
.
var_dump(100 < TRUE); // FALSE - same as (bool)100 < TRUE
var_dump(-10 < FALSE);// FALSE - same as (bool)-10 < FALSE
Should be -
if( ($c > $b) && ($c> $a)) {
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments