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

Constructor property promotion

Constructor property promotion combines a constructor parameter with a property declaration using a visibility modifier.

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

References left by foreach

A foreach by-reference binding and lingering reference let the loop variable alias each array element in turn, and then the last visited element after a nonempty loop.

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

Assignment by reference

Reference assignment (= &) makes two names refer to the same variable.

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

Parameters passed by reference

Pass-by-reference parameters put the ampersand in the declaration and bind the parameter to an argument variable.

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

Returning by reference

Returning by reference places & before the function name and returns a variable that a caller can alias using =&.

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

PHP type array

An array is an ordered map whose keys are integers or strings.

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

PHP type bool

A boolean stores true or false.

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

PHP type callable

A callable parameter accepts something that PHP can invoke, such as a closure or a public method paired with an object.

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

PHP type false

The literal type false describes exactly the boolean value false, for example a disabled flag.

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

PHP type float

A float represents a floating-point number with finite precision.

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

PHP type int

An integer is a signed whole number within platform-dependent limits.

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

PHP type iterable

An iterable parameter accepts an array or an object implementing Traversable.

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

PHP type mixed

The mixed declaration explicitly accepts all PHP values, including null, resources and objects.

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

PHP type never

A never return type promises that no normal return occurs.

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

PHP type null

The null type has exactly one value, null.

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

PHP type object

The object declaration accepts any object, without guaranteeing that a particular method or property exists.

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

PHP type parent

Inside a derived class, parent denotes its direct base class in a type declaration.

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

PHP type resource

A resource is a runtime handle managed by an extension, such as an open stream.

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

PHP type self

Within a class, self in a type declaration refers to the declaring class.

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

PHP type static

A static return type is tied to the class through which the method is called.

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

PHP type string

A PHP string is a sequence of bytes and can contain a zero byte.

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

PHP type true

The literal type true denotes exactly the boolean value true.

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

PHP type void

A void return declaration describes a procedure called for its effects.

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

$GLOBALS

The superglobal $GLOBALS exposes global variables under their string names from any scope.

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