php-dextrin

Tags
in package

FinalYes

Pure constants -- CBOR tag numbers and bit-layout tables, mirroring `dxn/DXN.md` §2.3 verbatim. No behavior beyond the flag<->byte conversions, which exist here (not in the encoder/decoder) as one shared source of truth for the bit layout, used by both directions.

Table of Contents

Constants

DURATION_FIELDS  : mixed = ['years', 'months', 'weeks', 'days', 'hours', '...
Duration bitmask field order, low bit first (`DXN.md` §2.3).
REGEX_FLAG_BITS  : mixed = ['i', 'm', 's', 'u', 'x', 'f', 'r']
Regex flags byte bit order, low bit first (`DXN.md` §2.3).
T_ARRAY  : mixed = 204
T_BIGNUM_NEG  : mixed = 3
T_BIGNUM_POS  : mixed = 2
T_BITS  : mixed = 216
A run of bits that is not whole bytes: `[bytes, count]` (DXN.md §2.3).
T_CHAR  : mixed = 200
T_CUSTOM  : mixed = 214
T_DATE  : mixed = 209
T_DATETIME  : mixed = 219
`[epoch-nanoseconds, offset-minutes]`, or in UTC the bare epoch-nanoseconds (the smallest representation, DXN.md §2.2).
T_DATETIME_US  : mixed = 211
T_DECIMAL  : mixed = 4
T_DURATION  : mixed = 220
The duration bitmask, its seventh field nanoseconds.
T_DURATION_US  : mixed = 212
T_EXTRA  : mixed = 215
A struct's extra fields: only ever its last item (DXN.md §2.3).
T_IPV4  : mixed = 52
T_IPV6  : mixed = 54
T_KEYWORD  : mixed = 202
T_LOCAL_DATETIME  : mixed = 217
A local date-time: nanoseconds since 1970-01-01T00:00:00 on the wall clock (DXN.md §2.3, Jan, 2026-10-20).
T_OBJECTID  : mixed = 221
BSON's ObjectId: 12 raw bytes (Jan, 2026-10-20).
T_ORDERED  : mixed = 205
T_RATIONAL  : mixed = 30
T_REGEX  : mixed = 213
T_SET  : mixed = 206
T_SHAREABLE  : mixed = 28
T_SHARED_REF  : mixed = 29
T_SORTED_SET  : mixed = 207
T_STRINGREF  : mixed = 25
T_STRINGREF_NAMESPACE  : mixed = 256
T_STRUCT  : mixed = 208
T_SYMBOL  : mixed = 201
T_TIME  : mixed = 218
Nanoseconds since midnight.
T_TIME_US  : mixed = 210
T_TIMESTAMP_US  : mixed = 1
DXN 0.2's UTC timestamp, epoch microseconds: read, never written (DXN.md §2.3, Jan, 2026-10-20).
T_TUPLE  : mixed = 203
T_URI  : mixed = 32
T_UUID  : mixed = 37

Methods

durationBitmask()  : int
durationFieldsPresent()  : array<int, string>
regexByteToFlags()  : array<string, bool>
regexFlagsToByte()  : int
__construct()  : mixed

Constants

DURATION_FIELDS

Duration bitmask field order, low bit first (`DXN.md` §2.3).

public mixed DURATION_FIELDS = ['years', 'months', 'weeks', 'days', 'hours', 'minutes', 'nanoseconds']

REGEX_FLAG_BITS

Regex flags byte bit order, low bit first (`DXN.md` §2.3).

public mixed REGEX_FLAG_BITS = ['i', 'm', 's', 'u', 'x', 'f', 'r']

T_ARRAY

public mixed T_ARRAY = 204

T_BIGNUM_NEG

public mixed T_BIGNUM_NEG = 3

T_BIGNUM_POS

public mixed T_BIGNUM_POS = 2

T_BITS

A run of bits that is not whole bytes: `[bytes, count]` (DXN.md §2.3).

public mixed T_BITS = 216

T_CHAR

public mixed T_CHAR = 200

T_CUSTOM

public mixed T_CUSTOM = 214

T_DATE

public mixed T_DATE = 209

T_DATETIME

`[epoch-nanoseconds, offset-minutes]`, or in UTC the bare epoch-nanoseconds (the smallest representation, DXN.md §2.2).

public mixed T_DATETIME = 219

T_DATETIME_US

public mixed T_DATETIME_US = 211

T_DECIMAL

public mixed T_DECIMAL = 4

T_DURATION

The duration bitmask, its seventh field nanoseconds.

public mixed T_DURATION = 220

T_DURATION_US

public mixed T_DURATION_US = 212

T_EXTRA

A struct's extra fields: only ever its last item (DXN.md §2.3).

public mixed T_EXTRA = 215

T_IPV4

public mixed T_IPV4 = 52

T_IPV6

public mixed T_IPV6 = 54

T_KEYWORD

public mixed T_KEYWORD = 202

T_LOCAL_DATETIME

A local date-time: nanoseconds since 1970-01-01T00:00:00 on the wall clock (DXN.md §2.3, Jan, 2026-10-20).

public mixed T_LOCAL_DATETIME = 217

T_OBJECTID

BSON's ObjectId: 12 raw bytes (Jan, 2026-10-20).

public mixed T_OBJECTID = 221

T_ORDERED

public mixed T_ORDERED = 205

T_RATIONAL

public mixed T_RATIONAL = 30

T_REGEX

public mixed T_REGEX = 213

T_SET

public mixed T_SET = 206

T_SHAREABLE

public mixed T_SHAREABLE = 28

T_SHARED_REF

public mixed T_SHARED_REF = 29

T_SORTED_SET

public mixed T_SORTED_SET = 207

T_STRINGREF

public mixed T_STRINGREF = 25

T_STRINGREF_NAMESPACE

public mixed T_STRINGREF_NAMESPACE = 256

T_STRUCT

public mixed T_STRUCT = 208

T_SYMBOL

public mixed T_SYMBOL = 201

T_TIME

Nanoseconds since midnight.

public mixed T_TIME = 218

T_TIME_US

public mixed T_TIME_US = 210

T_TIMESTAMP_US

DXN 0.2's UTC timestamp, epoch microseconds: read, never written (DXN.md §2.3, Jan, 2026-10-20).

public mixed T_TIMESTAMP_US = 1

T_TUPLE

public mixed T_TUPLE = 203

T_URI

public mixed T_URI = 32

T_UUID

public mixed T_UUID = 37

Methods

durationFieldsPresent()

public static durationFieldsPresent(int $bitmask) : array<int, string>
Parameters
$bitmask : int
Return values
array<int, string>

regexByteToFlags()

public static regexByteToFlags(int $byte) : array<string, bool>
Parameters
$byte : int
Return values
array<string, bool>

regexFlagsToByte()

public static regexFlagsToByte(array<string, bool> $flags) : int
Parameters
$flags : array<string, bool>
Return values
int

__construct()

private __construct() : mixed
On this page

Search results