Wednesday 15 November 2017

echo - Strange print behaviour in PHP?

Refer to href="http://php.net/manual/en/language.operators.bitwise.php#example-115"
rel="nofollow">Bitwise
Operators
:



We have to find
4 << 5. It means shift the bits of 4 5 times to the
left:




4 is
00000000000000000000000000000100
4 << 5 after shifting is
00000000000000000000000010000000
00000000000000000000000010000000 is 2^7 =
2*2*2*2*2*2*2 = 128

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...