Oihana PHP Arango

bitConstruct.php

Table of Contents

Functions

bitConstruct()  : string
Construct a number with its bits set at the positions given in an array (zero-based).

Functions

bitConstruct()

Construct a number with its bits set at the positions given in an array (zero-based).

bitConstruct(string|array<string|int, mixed> $positions) : string

Wraps the ArangoDB AQL function BIT_CONSTRUCT(positionsArray). It is the inverse of bitDeconstruct(). A PHP array is emitted as a JSON literal; a string is passed through as a raw AQL expression.

Example AQL usage:

BIT_CONSTRUCT([1, 2, 3])   // returns 14
Parameters
$positions : string|array<string|int, mixed>

The bit positions to set (array literal or AQL expression).

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

$expr = bitConstruct([1, 2, 3]);   // 'BIT_CONSTRUCT([1,2,3])'
see
https://docs.arangodb.com/stable/aql/functions/bit/#bit_construct
bitDeconstruct()
since
1.1.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results