Oihana PHP Arango

bitAnd.php

Table of Contents

Functions

bitAnd()  : string
Return the bitwise AND of its operands.

Functions

bitAnd()

Return the bitwise AND of its operands.

bitAnd(string|int|array<string|int, mixed> $values[, string|int|null $value2 = null ]) : string

Wraps the ArangoDB AQL function BIT_AND(), which has two forms:

  • an array of numbers: BIT_AND(numbersArray),
  • two number operands: BIT_AND(value1, value2) (pass $value2).

PHP arrays are emitted as JSON literals; strings are passed through as raw AQL expressions.

Example AQL usage:

BIT_AND([1, 4, 8, 16])   // returns 0
BIT_AND(127, 255)        // returns 127
Parameters
$values : string|int|array<string|int, mixed>

The numbers array, or the first operand when $value2 is given.

$value2 : string|int|null = null

The second operand (selects the two-number form).

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

$expr = bitAnd([1, 4, 8, 16]);   // 'BIT_AND([1,4,8,16])'
$expr = bitAnd(127, 255);        // 'BIT_AND(127,255)'
see
https://docs.arangodb.com/stable/aql/functions/bit/#bit_and
since
1.1.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results