I was reading some php code source and found the following:
$failed |= is_numeric( $key );
Other than if $key is numeric , what does |= mean?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
$x |= $y;is the same as$x = $x | $y;$x | $yis 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
$failedto 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