final class Arrays
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.

Ordered PHP array updates, append indices, and distinct unpack/merge semantics.

Methods§

public function set(Term $array, Term|null $key, Term $value): Term

Updates a known key or preserves a conservative unknown-key remainder.

Parameters

$arrayTermArray shape
$keyTerm|nullNull denotes append syntax
$valueTermAssigned value

Returns

Term Updated array or explicit throwable
Test cases 9
Called from 5
Calls 16
public function merge(Term $left, Term $right): Term

Appends numeric entries and overwrites named entries for unpack/array_merge.

Parameters

$leftTermDestination
$rightTermSource

Returns

Term Merged array with conservative remainder
Test cases 12
Called from 4
Calls 7
public function head(Term $array): Term|null

Finds the closed integer-keyed destination at the start of a symbolic merge, whose entries no source can replace or reorder.

Parameters

$arrayTermPossibly symbolic merge

Returns

Term|null Leading entries in order, or null when the merge has no such destination
Test cases 1
Called from 7
Calls 7
public function split(Term $array): array{Term, Term}|null

Separates a single symbolic merge into its known head and the source appended after it.

Parameters

$arrayTermPossibly symbolic merge

Returns

array{Term, Term}|null Head and appended source, or null when either part is not separable
Test cases 1
Called from 1
Calls 1
public function tail(Term $array): array{Term, Term}|null
public function appendable(Term $array): bool

Checks that appending arrays cannot reach the occupied maximum append index; a PHP array holds fewer than 2^32 elements.

Parameters

$arrayTermUnpack destination

Returns

bool Whether every later append index is provably available
Test cases 1
Called from 3
Calls 3

Test cases 106§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 18
Other tests reaching this symbol 88

Relations§

Instantiated in 22
Method calls 24