note 95614 added to language.operators.bitwise
| From: | Anonymous at osu1 dot php dot net | Date: | Tue, 12 Jan 2010 18:18:34 +0000 |
| Subject: | note 95614 added to language.operators.bitwise | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-164884@lists.php.net to get a copy of this message | ||
Beware that PHP's << and >> operators, unlike the other bitwise operators do not
work on ASCII values; << and >> cast their operands to integer (when possible) before
shifting and will always return an integer result.
For example:
<?php
$foo = "1"; // chr(49)
var_dump($foo << 1); // Output is int(2)
$foo = "!"; // chr(33)
var_dump($foo << 1); // Output is int(0)
?>
----
Server IP: 192.41.40.227
Probable Submitter: 67.237.232.160
----
Manual Page -- http://www.php.net/manual/en/language.operators.bitwise.php
Edit -- https://master.php.net/note/edit/95614
Del: integrated -- https://master.php.net/note/delete/95614/integrated
Del: useless -- https://master.php.net/note/delete/95614/useless
Del: bad code -- https://master.php.net/note/delete/95614/bad+code
Del: spam -- https://master.php.net/note/delete/95614/spam
Del: non-english -- https://master.php.net/note/delete/95614/non-english
Del: in docs -- https://master.php.net/note/delete/95614/in+docs
Del: other reasons-- https://master.php.net/note/delete/95614
Reject -- https://master.php.net/note/reject/95614
Search -- https://master.php.net/manage/user-notes.php