What does >> mean in PHP?

后端 未结 8 1880
天涯浪人
天涯浪人 2021-02-19 05:13

Consider:

echo 50 >> 4;

Output:

3

Why does it output 3?

8条回答
  •  眼角桃花
    2021-02-19 05:52

    It shifts the bits down four places.

    50 in binary is 110010.

    Shifted down four places is 11, which is 3.

提交回复
热议问题