$a <<= $b

Bitshift left assignment

Apply a binary "bitshift left" operation and assign the first variable to the result.

Tags
// Binary representation of 5: 00000101
$a = 5; 

// returns binary result: 00010100
$a <<= 2;

// $a is also updated to binary result 00010100
$a;

null coalescing

What is this? Who are you!?

PHP Operators is a reference guide for operators old and new in the PHP programming language. We're SPATIE, a web development agency from Belgium. Besides client work we like to contribute to the open source community and make fun projects like this one.