I was reading some php code source and found the following:
$failed |= is_numeric( $key );
Other than if $key
is numeric , what does |=
mean?
$x |= $y;
is the same as $x = $x | $y;
$x | $y
is a bitwise operator which means it returns the result of a logical 'or' between the two variables.
In the context of the question, it allows $failed
to store failure statuses for several actions in a single variable (each bit position representing an individual action).
If you need to know more about what this does, I suggest reading the PHP manual page for bitwise operators: http://www.php.net/manual/en/language.operators.bitwise.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With