Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我<<在一个 php 脚本中找到了,我想知道它是如何工作的;
<<
例如:
echo 2 << 4;
它打印 32
左移
来自 php.net 的Bitwise Operators手册:
将 $a $b 的位向左移动(每一步的意思是“乘以二”)
2 << 4方法2 * 2^4 = 32
2 << 4
2 * 2^4 = 32