Oihana PHP Arango

bitXor.php

Table of Contents

Functions

bitXor()  : string
Return the bitwise XOR (exclusive or) of its operands.

Functions

bitXor()

Return the bitwise XOR (exclusive or) of its operands.

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

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

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

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

Example AQL usage:

BIT_XOR([1, 2, 3])   // returns 0
BIT_XOR(1, 5)        // returns 4
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\bitXor;

$expr = bitXor([1, 2, 3]);   // 'BIT_XOR([1,2,3])'
$expr = bitXor(1, 5);        // 'BIT_XOR(1,5)'
see
https://docs.arangodb.com/stable/aql/functions/bit/#bit_xor
since
1.1.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results