Stringable
Mark an object that can supply a string representation through __toString.
CKTIS / Knowledge base
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
Mark an object that can supply a string representation through __toString.
Use the shared interface of Error and Exception to handle both object hierarchies.
Accept objects with iterator behavior through this marker interface.
Identify a value that fails a declared or required type, for instance a wrong argument or return. strict_types suppresses most scalar coercion at a user-function call site.
UnexpectedValueException specializes RuntimeException for a value that does not match what a runtime operation expects, often a return value from another component.
Identify a value of an acceptable type that the operation cannot use.
Map object identities to data without a strong reference from the map to its keys.
Observe an object without prolonging its lifetime. get returns the same live object while a strong reference exists, then null after destruction.
Place the pricing rule behind a service and inject an interface for the changing data source.
A scheduler can interleave tasks by starting fibers and resuming only suspended ones.
An attribute attaches structured metadata to a declaration without invoking its constructor at the point of use.
Determine whether an authenticated actor may perform a specific action on a particular record.
A PHP array is an ordered map with int or string keys.
Use // or # for a line comment and /* ... */ for a block.
An if test converts its condition to bool.
Connect a producer, validator and consumer with iterable inputs.
Use an assignment pattern to select fields and unpack nested arrays.
Throwable covers Exception and Error objects, including TypeError.
Precedence groups operators into expressions.
A fiber can suspend from a helper several calls deep, preserving that stack until resumed.
Use a predicate to select rows and a transformation to compute new values. array_filter preserves surviving keys, and array_map with one input also preserves keys.
Represent a closed state set with an enum and express permitted state/event pairs in match arms.
Compose callables by passing the entire return value of the first as the argument of the next.
Parameters receive values by default.