Several things happen here:
First, in PHP, the result of a boolean operation is logical.
Secondly, and more subtly, "English" Boolean operators ( orand and) have the lowest precedence - below the assignment operator =.
$result $a ( $a), .
$result = $a or $b or $c;
$result = $a;
$a or $b or $c;
, .
, - $a, $b, $c (.. true true), "C-" (|| &&), :
$result = ($a or $b or $c);
$result = $a || $b || $c;
if ($a or $b or $c)
$result = true;
else
$result = false;
if ($a || $b || $c)
$result = true;
else
$result = false;
, - , , , .
(, ), .
, ( , , ) array_filter - all , , .
:
$a = false;
$b = false;
$c = 'sometext';
$result = array_filter(array($a, $b, $c));
var_dump($result);
:
array(1) {
[2]=>
string(8) "sometext"
}