PHP. Can somebody explain me what
|=
means in the following lines of code?
$mark = true;
$options = FT_UID;
if(!$mark) {
$options |= FT_PEEK;
}
I've read | is a bitwise operation which operates on bits but I still don't get it..
PHP. Can somebody explain me what
|=
means in the following lines of code?
$mark = true;
$options = FT_UID;
if(!$mark) {
$options |= FT_PEEK;
}
I've read | is a bitwise operation which operates on bits but I still don't get it..
It is read "OR equals." So it ors the lvalue with the rvalue and assigns to the lvalue.
$a = 0;
..
$a |= $b
is the same as
$a = $a | $b