Pascal <-> PHP | Bitwise right shift

Pascal

shr

Description

par1 shr par2
Used keywords: shr

Input


Output

Examples

Pascal

Bitwise right shift the possible of use:
x := 8 shr 1;        { x = 4}
y := $ff shr 4;     { y = 15}
z := (x shr 2) shr 2; { z = 0}

Pascal

Even one example in what situations we can use the operation bitwise right shift:
i shr 2
2 shr i
32 shr ($A shr 2) shr 1
.
PHP

>>

Description

par1 >> par2
Used keywords: >>

Input


Output

Examples

PHP

Bitwise right shift the possible of use:
$x = 8 >> 1;        // x = 4
$y = 0xff >> 4;     // y = 15
$z = ($x >> 2) >> 2; // z = 0

PHP

Even one example in what situations we can use the operation bitwise right shift:
$i >> 2
2 >> $i
32 >> (0xA >> 2) >> 1

You can find it in the following collections: bitwise operators
Languages: en hu cz sk