note 105157 added to language.operators.bitwise
| From: | Anonymous at osu1 dot php dot net | Date: | Sun, 31 Jul 2011 11:33:24 +0000 |
| Subject: | note 105157 added to language.operators.bitwise | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-182026@lists.php.net to get a copy of this message | ||
Using stings will just use every byte of the string - which is for me not unexpected at all:
<?php
'18'& '32'== '10'
// ord( '1' )== 49, ord( '8' )== 56, ord( '3' )== 51, ord(
'2' )== 50
// 49& 51== 49, 56& 50== 48
// chr( 49 )== '1', chr( 48 )== '0'
?>
You have to typecast each operand to the data type you're expecting.
----
Server IP: 69.147.83.197
Probable Submitter: 85.180.136.57
----
Manual Page -- http://www.php.net/manual/en/language.operators.bitwise.php
Edit -- https://master.php.net/note/edit/105157
Del: integrated -- https://master.php.net/note/delete/105157/integrated
Del: useless -- https://master.php.net/note/delete/105157/useless
Del: bad code -- https://master.php.net/note/delete/105157/bad+code
Del: spam -- https://master.php.net/note/delete/105157/spam
Del: non-english -- https://master.php.net/note/delete/105157/non-english
Del: in docs -- https://master.php.net/note/delete/105157/in+docs
Del: other reasons-- https://master.php.net/note/delete/105157
Reject -- https://master.php.net/note/reject/105157
Search -- https://master.php.net/manage/user-notes.php