I don’t understand what’s going on here in PHP.
I’ve spent hours on this until I understood that it doen’t work normally, or that I dont understand something.
Here the few lines :
$test = false OR false OR true;
echo $test;
Here $test is false, nothing is printed.
Also, if I try:
if($test){
echo "IT'S TRUE";
}
Nothing is printed.
BUT HERE :
if(false OR false OR true){
echo "IT'S TRUE";
}
“IT’S TRUE” is printed.
So the statement “false OR false OR true” is false when assigned to a variable, but true when is a condition.
Does anyone know and can explain to me why ?