I am converting a C# routine to php
do not understand how to do this C#
bool ret = false;
ret ^= (y * multiple[i] + constant[i] < x);
its the operator ^=
??
I am converting a C# routine to php
do not understand how to do this C#
bool ret = false;
ret ^= (y * multiple[i] + constant[i] < x);
its the operator ^=
??
Short answer: in PHP you can use the same ^=
operator.
The x ^= y
is equivalent to x = x ^ y
with ^
the bitwise xor operator.
In PHP ^
is also the bitwise xor operator. So it is the same in PHP, you can use:
$ret ^= ($y * $multiple[$i] + $constant[$i] < $x);
given of course that $y
, $multiple
, $i$
, etc. all have an equivalent meaning.