note 105370 added to language.operators.bitwise

From: Date: Fri, 12 Aug 2011 12:07:51 +0000
Subject: note 105370 added to language.operators.bitwise
Groups: php.notes 
Request: Send a blank email to php-notes+get-182442@lists.php.net to get a copy of this message
It is true that if both the left-hand and right-hand parameters are strings, the bitwise operator will operate on the characters' ASCII values. However, a complement is necessary to complete this sentence. It is not irrelevant to point out that the decimal character's ASCII value have different binary values. <?php if (('18' & '32') == '10') { echo ord('18'); //return decimal value 49, which have binary value 110001 echo ord('32'); //return decimal value 51, which have binary value 110011 echo ord('10'); //return decimal value 49, which have binary value 110001 //Therefore 110001 & 110011 = 110001 } ?> ---- Server IP: 195.114.0.19 Probable Submitter: 194.169.228.10 ---- Manual Page -- http://www.php.net/manual/en/language.operators.bitwise.php Edit -- https://master.php.net/note/edit/105370 Del: integrated -- https://master.php.net/note/delete/105370/integrated Del: useless -- https://master.php.net/note/delete/105370/useless Del: bad code -- https://master.php.net/note/delete/105370/bad+code Del: spam -- https://master.php.net/note/delete/105370/spam Del: non-english -- https://master.php.net/note/delete/105370/non-english Del: in docs -- https://master.php.net/note/delete/105370/in+docs Del: other reasons-- https://master.php.net/note/delete/105370 Reject -- https://master.php.net/note/reject/105370 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#182442) next »