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

Lowers trusted plans into the same SSA instructions and control-flow blocks as PHP.

Properties§

public array<int, list<Instruction>> $instructions = [0 => []]
public array<int, Terminator> $terminators = []
public int $current = 0

Current block.

public int $sequence = 0

SSA sequence.

public SourceRef $source

Methods§

public function __construct(public SourceRef $source)

Parameters

$sourceSourceRefEvaluator declaration provenance
public function expression(Expression $expression): string

Emits a evaluator expression as shared solver instructions.

Parameters

$expressionExpressionDeclarative expression

Returns

string Result register

Throws

InvalidInputException If the plan contains an unsupported opcode
Test cases 6
Called from 6
Calls 18
public function choice(Action $action, string $condition): void

Creates correlated evaluator branches with one continuation.

Parameters

$actionActionConditional action
$conditionstringPredicate register
Test cases 1
Called from 1
Calls 5
public function emit(
    string $operation,
    list<string> $operands = [],
    string $name = '',
    Term|null $constant = null,
    list<Argument> $arguments = [],
    array<string, scalar|null> $attributes = [],
): string

Emits one evaluator instruction with stable evaluator provenance.

Parameters

$operationstring\Deriver\Deriver\Lowerer\Graph\Instruction operation
$operandslist<string>Register inputs
$namestringOperation-specific name
$constantTerm|nullLiteral payload
$argumentslist<Argument>Call arguments
$attributesarray<string, scalar|null>Operation metadata

Returns

string Result register
Test cases 2
Called from 19
Calls 1

Test cases 67§

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

Dedicated tests 11
Other tests reaching this symbol 56

Relations§

Instantiated in 3
Method calls 24
Type declarations 3