SplPriorityQueue
Associate data with priorities and extract the highest-priority entry first. setExtractFlags chooses data, priority or both.
CKTIS / PHP
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
Associate data with priorities and extract the highest-priority entry first. setExtractFlags chooses data, priority or both.
Process values in first-in, first-out order. enqueue adds at the tail and dequeue removes the head. bottom inspects the next item without consuming it.
Process values in last-in, first-out order. push and pop use the same end, so the newest value is removed first. top inspects that value without changing the count.
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.