JsonArrayElements
Read onlyYes
FinalYes
One PCRE match per top-level element (~8x JSON Machine); anything unrecognised falls back to JSON Machine.
Methods
- __construct() : mixed
- of() : Generator<mixed, mixed>
- $fallback yields the whole document's items through JSON Machine, skipping the given number of leading items - so a scalar element, a malformed element, a missing separator or a document that is not an array yields or refuses exactly what JSON Machine always did, and never repeats an item this already yielded.
Methods
__construct()
public
__construct([int<1, max> $chunk = 1 << 20 ]) : mixed
Parameters
- $chunk : int<1, max> = 1 << 20
-
bytes read from the stream per refill
of()
$fallback yields the whole document's items through JSON Machine, skipping the given number of leading items - so a scalar element, a malformed element, a missing separator or a document that is not an array yields or refuses exactly what JSON Machine always did, and never repeats an item this already yielded.
public
of(SourceStream $stream, string $first, callable(int): iterable<string|int, mixed> $fallback) : Generator<mixed, mixed>
Parameters
- $stream : SourceStream
- $first : string
-
the stream's first bytes, already read at offset 0
- $fallback : callable(int): iterable<string|int, mixed>