note 39977 added to language.operators.bitwise

From: Date: Tue, 17 Feb 2004 14:03:46 +0000
Subject: note 39977 added to language.operators.bitwise
Groups: php.notes 
Request: Send a blank email to php-notes+get-65277@lists.php.net to get a copy of this message
Beware that strings can be ANDed, XORed, and ORed just fine. When printing the results of a bitwise operation, results can be a bit confusing, since operands may be converted to strings BEFORE bitwise operator execution. so, use this: print('result: '); print(pow(2, $pos) & $this->_bits); print('<br>'); NOT this print("result: " . pow(2, $pos) & $this->_bits . "<br>"); ---- Manual Page -- http://www.php.net/manual/en/language.operators.bitwise.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+39977 Delete -- http://master.php.net/manage/user-notes.php?action=delete+39977&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+39977&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#65277) next »