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

From: Date: Fri, 16 Aug 2013 05:51:24 +0000
Subject: Doc #65457 [NEW]: Example on Bitwise Operators page: XOR is not same as AND NOT
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-10168@lists.php.net to get a copy of this message
From: david at beroff dot com Operating system: Irrelevant PHP version: Irrelevant Package: Documentation problem Bug Type: Documentation Problem Bug description:Example on Bitwise Operators page: XOR is not same as AND NOT 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 bug report at https://bugs.php.net/bug.php?id=65457&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=65457&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=65457&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=65457&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=65457&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=65457&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=65457&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=65457&r=needscript Try newer version: https://bugs.php.net/fix.php?id=65457&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=65457&r=support Expected behavior: https://bugs.php.net/fix.php?id=65457&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=65457&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=65457&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=65457&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65457&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=65457&r=dst IIS Stability: https://bugs.php.net/fix.php?id=65457&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=65457&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=65457&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=65457&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=65457&r=mysqlcfg

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