final class NullLiteral
    implements Scalar
    uses Snapshot
Public API: explicitly declared with @visibility public.

The NULL literal.

Rule: MYSQL-NULL-LITERAL-001. Facts: the type of a bare NULL; always NULL. Source: https://dev.mysql.com/doc/refman/8.4/en/null-values.html. Status: Implemented.

Typing a bare NULLdoctest
$query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('SELECT a FROM t WHERE a = NULL');
    $query->facts->scalar($query->statement->where->right)->nullability // => \SqlSemantics\Platform\MySql\Model\Statement\Type\Nullability::Nullable

Methods§

public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives the NULL-only type.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

Calls 3
public function render(Output $out): void

Writes the keyword.

Parameters

$outOutput
Calls 1

Test cases 23§

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

Dedicated tests 2
Other tests reaching this symbol 21

Relations§

Instantiated in 1
Type checks 2