Module shared

Module shared 

Source
Expand description

A collection of shared, static, and lazily-initialized TAtomic types.

This module provides canonical, reusable instances for common PHP types. Using these constants avoids repeated allocations for frequently used types.

Constants§

ARRAYKEY_ATOMIC
A static TAtomic representing the array-key type (int|string).
BOOL_ATOMIC
A static TAtomic representing the bool type.
CLASS_STRING_ATOMIC
A static TAtomic representing the class-string type.
CLOSED_RESOURCE_ATOMIC
A static TAtomic representing a closed resource.
ENUM_STRING_ATOMIC
A static TAtomic representing the enum-string type.
FALSE_ATOMIC
A static TAtomic representing the literal false type.
FALSY_MIXED_ATOMIC
A static TAtomic representing any “falsy” value (e.g., false, 0, "", []).
FLOAT_ATOMIC
A static TAtomic representing the float type.
INTERFACE_STRING_ATOMIC
A static TAtomic representing the interface-string type.
INT_ATOMIC
A static TAtomic representing the general int type.
INT_FLOAT_ATOMIC_SLICE
A static slice of atomics representing the union type int|float.
INT_STRING_ATOMIC_SLICE
A static slice of atomics representing the union type int|string.
ISSET_FROM_LOOP_MIXED_ATOMIC
A static TAtomic representing a mixed type that originates from an isset() check inside a loop.
LOWERCASE_STRING_ATOMIC
A static TAtomic for a lowercase-string.
MINUS_ONE_INT_ATOMIC
A static TAtomic representing the integer literal -1.
MIXED_ATOMIC
A static TAtomic representing the mixed type.
NEGATIVE_INT_ATOMIC
A static TAtomic representing a negative integer (negative-int or int<min, -1>).
NEVER_ATOMIC
A static TAtomic representing the never type, which indicates an impossible state.
NON_EMPTY_LOWERCASE_STRING_ATOMIC
A static TAtomic for a non-empty-lowercase-string.
NON_EMPTY_STRING_ATOMIC
A static TAtomic for a non-empty-string.
NON_EMPTY_UNSPECIFIED_LITERAL_STRING_ATOMIC
A static TAtomic representing a non-empty literal-string where the value is unknown.
NON_NEGATIVE_INT_ATOMIC
A static TAtomic representing a non-negative integer (non-negative-int or int<0, max>).
NON_NULL_ATOMIC
A static TAtomic representing any value that is not null.
NON_POSITIVE_INT_ATOMIC
A static TAtomic representing a non-positive integer (non-positive-int or int<min, 0>).
NULL_ATOMIC
A static TAtomic representing the null type.
NULL_FLOAT_ATOMIC_SLICE
A static slice of atomics representing the union type null|float.
NULL_INT_ATOMIC_SLICE
A static slice of atomics representing the union type null|int.
NULL_OBJECT_ATOMIC_SLICE
A static slice of atomics representing the union type null|object.
NULL_SCALAR_ATOMIC_SLICE
A static slice of atomics representing the union type null|scalar.
NULL_STRING_ATOMIC_SLICE
A static slice of atomics representing the union type null|string.
NUMERIC_ATOMIC
A static TAtomic representing the numeric type (int|float|numeric-string).
NUMERIC_STRING_ATOMIC
A static TAtomic for a numeric-string.
NUMERIC_TRUTHY_STRING_ATOMIC
A static TAtomic for a numeric-string that is also truthy.
OBJECT_ATOMIC
A static TAtomic representing the general object type.
ONE_INT_ATOMIC
A static TAtomic representing the integer literal 1.
OPEN_RESOURCE_ATOMIC
A static TAtomic representing an open resource.
PLACEHOLDER_ATOMIC
A static TAtomic used as a temporary placeholder during type reconciliation.
POSITIVE_INT_ATOMIC
A static TAtomic representing a positive integer (positive-int or int<1, max>).
RESOURCE_ATOMIC
A static TAtomic representing the resource type.
SCALAR_ATOMIC
A static TAtomic representing the scalar type (int|float|string|bool).
SIGNUM_RESULT_SLICE
A static slice of atomics representing the union type -1|0|1, commonly returned by comparison operations like the spaceship operator (<=>).
STRING_ATOMIC
A static TAtomic for the general string type.
TRAIT_STRING_ATOMIC
A static TAtomic representing the trait-string type.
TRUE_ATOMIC
A static TAtomic representing the literal true type.
TRUTHY_LOWERCASE_STRING_ATOMIC
A static TAtomic for a truthy-lowercase-string.
TRUTHY_MIXED_ATOMIC
A static TAtomic representing any “truthy” value.
TRUTHY_STRING_ATOMIC
A static TAtomic for a truthy-string.
UNSPECIFIED_LITERAL_FLOAT_ATOMIC
A static TAtomic representing the literal-float type (unspecified literal).
UNSPECIFIED_LITERAL_INT_ATOMIC
A static TAtomic representing a literal-int where the value is unknown.
UNSPECIFIED_LITERAL_STRING_ATOMIC
A static TAtomic representing a literal-string where the value is unknown.
VOID_ATOMIC
A static TAtomic representing the void type.
ZERO_INT_ATOMIC
A static TAtomic representing the integer literal 0.

Statics§

EMPTY_KEYED_ARRAY_ATOMIC
A lazily-initialized static TAtomic for an empty array (array<never, never>).
EMPTY_STRING_ATOMIC
A static TAtomic representing an empty string literal ("").
MIXED_CALLABLE_ATOMIC
A lazily-initialized static TAtomic for a mixed callable (callable).
MIXED_CLOSURE_ATOMIC
A lazily-initialized static TAtomic for a mixed closure (Closure).
MIXED_ITERABLE_ATOMIC
A lazily-initialized static TAtomic for a mixed iterable (iterable<mixed, mixed>).
MIXED_KEYED_ARRAY_ATOMIC
A lazily-initialized static TAtomic for a mixed array (array<array-key, mixed>).