Oihana PHP Arango

bitShiftLeft.php

Table of Contents

Functions

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

Functions

bitShiftLeft()

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

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

Wraps the ArangoDB AQL function BIT_SHIFT_LEFT(value, shift, bits). Bits that overflow past bits positions are discarded.

Example AQL usage:

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

The number to shift.

$shift : string|int

The number of positions to shift left.

$bits : string|int

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

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

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

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results