Doc #65457 [Nab]: Example on Bitwise Operators page: XOR is not same as AND NOT

From: Date: Mon, 19 Aug 2013 05:49:57 +0000
Subject: Doc #65457 [Nab]: Example on Bitwise Operators page: XOR is not same as AND NOT
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-10181@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=65457&edit=1 ID: 65457 User updated by: david at beroff dot com Reported by: david at beroff dot com Summary: Example on Bitwise Operators page: XOR is not same as AND NOT Status: Not a bug Type: Documentation Problem Package: Documentation problem Operating System: Irrelevant PHP Version: Irrelevant Block user comment: N Private report: N New Comment: I do completely agree with your first sentence. Would you please then at least consider changing the words, "Another way to accomplish that is using", to simply, "One can use"? This would then meet your requirements, as well as addressing mine, by removing the suggestion that the act is equivalent. Thank you. Previous Comments: ------------------------------------------------------------------------ [2013-08-19 05:21:31] krakjoe@php.net It is not the job of the PHP manual to educate the reader on bitwise comparisons, it is the job of the manual to educate the reader on bitwise comparisons _in PHP_. There is no good reason to remove the example, why it works is explained well. ------------------------------------------------------------------------ [2013-08-16 05:51:24] david at beroff dot com Description: ------------ On http://php.net/manual/en/language.operators.bitwise.php , there is an example which states, "Another way to accomplish... [E_ALL & ~E_NOTICE] ...is [by] using XOR...". While this yields the same result in THIS particular example, (because all of the relevant bits of E_ALL are set), it could have the undesired effect of incorrectly leading people to assume that this shortcut can/should be used in all cases. In a case where the first value had a cleared bit in the desired location, use of XOR would actually turn it on, rather than having the intended effect of turning it off. There is actually a comment (#98979) left by steffen at NO-SPAM dot haugk dot co dot uk to the same effect, but apparently no action had been taken in the three years since it was written. I respectfully ask you to please simply remove the example. Thank you. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=65457&edit=1

« previous php.doc.bugs (#10181) next »