Oihana PHP Arango

bitShiftRight.php

Table of Contents

Functions

bitShiftRight()  : string
Bitwise-shift the bits of a number to the right, keeping up to `bits` bits.

Functions

bitShiftRight()

Bitwise-shift the bits of a number to the right, keeping up to `bits` bits.

bitShiftRight(string|int $value, string|int $shift, string|int $bits) : string

Wraps the ArangoDB AQL function BIT_SHIFT_RIGHT(value, shift, bits). Bits that are shifted out past position 0 are discarded.

Example AQL usage:

BIT_SHIFT_RIGHT(16, 4, 8)   // returns 1
Parameters
$value : string|int

The number to shift.

$shift : string|int

The number of positions to shift right.

$bits : string|int

The number of bits to keep in the result (0 … 32).

Tags
example
use function oihana\arango\db\functions\bit\bitShiftRight;

$expr = bitShiftRight(16, 4, 8);   // 'BIT_SHIFT_RIGHT(16,4,8)'
see
https://docs.arangodb.com/stable/aql/functions/bit/#bit_shift_right
bitShiftLeft()
since
1.1.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results