Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / PHP

Knowledge base — PHP

Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.

Entries: 504

PHP

SplPriorityQueue

Associate data with priorities and extract the highest-priority entry first. setExtractFlags chooses data, priority or both.

Intermediate · PHP 8.4; repository runtime, production runtime not attested
PHP

SplQueue

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.

Intermediate · PHP 8.4; repository runtime, production runtime not attested
PHP

SplStack

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.

Intermediate · PHP 8.4; repository runtime, production runtime not attested
PHP

Stringable

Mark an object that can supply a string representation through __toString.

Intermediate · PHP 8.4; repository runtime, production runtime not attested
PHP

Throwable

Use the shared interface of Error and Exception to handle both object hierarchies.

Intermediate · PHP 8.4; repository runtime, production runtime not attested
PHP

Traversable

Accept objects with iterator behavior through this marker interface.

Intermediate · PHP 8.4; repository runtime, production runtime not attested
PHP

TypeError

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.

Intermediate · PHP 8.4; repository runtime, production runtime not attested
PHP

UnexpectedValueException

UnexpectedValueException specializes RuntimeException for a value that does not match what a runtime operation expects, often a return value from another component.

Intermediate · PHP 8.4; repository runtime, production runtime not attested
PHP

ValueError

Identify a value of an acceptable type that the operation cannot use.

Intermediate · PHP 8.4; repository runtime, production runtime not attested
PHP

WeakMap

Map object identities to data without a strong reference from the map to its keys.

Intermediate · PHP 8.4; repository runtime, production runtime not attested
PHP

WeakReference

Observe an object without prolonging its lifetime. get returns the same live object while a strong reference exists, then null after destruction.

Intermediate · PHP 8.4; repository runtime, production runtime not attested
PHP

Program architecture

Place the pricing rule behind a service and inject an interface for the changing data source.

Intermediate · PHP 8.4; repository runtime, production runtime not attested
PHP

Asynchrony and concurrency

A scheduler can interleave tasks by starting fibers and resuming only suspended ones.

Intermediate · PHP 8.4; repository runtime, production runtime not attested
PHP

Attributes and reflection

An attribute attaches structured metadata to a declaration without invoking its constructor at the point of use.

Intermediate · PHP 8.4; repository runtime, production runtime not attested
PHP

Resource authorization

Determine whether an authenticated actor may perform a specific action on a particular record.

Intermediate · PHP 8.4; repository runtime, production runtime not attested
PHP

Collections and array keys

A PHP array is an ordered map with int or string keys.

Intermediate · PHP 8.4; repository runtime, production runtime not attested
PHP

Comments and documentation

Use // or # for a line comment and /* ... */ for a block.

Intermediate · PHP 8.4; repository runtime, production runtime not attested
PHP

Conditional control flow

An if test converts its condition to bool.

Intermediate · PHP 8.4; repository runtime, production runtime not attested
PHP

Data processing pipelines

Connect a producer, validator and consumer with iterable inputs.

Intermediate · PHP 8.4; repository runtime, production runtime not attested
PHP

Array destructuring

Use an assignment pattern to select fields and unpack nested arrays.

Intermediate · PHP 8.4; repository runtime, production runtime not attested
PHP

Errors and exceptions

Throwable covers Exception and Error objects, including TypeError.

Intermediate · PHP 8.4; repository runtime, production runtime not attested
PHP

Expressions and operators

Precedence groups operators into expressions.

Intermediate · PHP 8.4; repository runtime, production runtime not attested
PHP

Fibers and cooperative scheduling

A fiber can suspend from a helper several calls deep, preserving that stack until resumed.

Intermediate · PHP 8.4; repository runtime, production runtime not attested
PHP

Filtering and transformations

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.

Intermediate · PHP 8.4; repository runtime, production runtime not attested