Glossary

Strict Types (strict_types)

strict_types is a PHP directive that enables strict type enforcement: if a function expects an int and receives a string, a TypeError is thrown instead of silently coercing the value. Adds safety and explicitness to the code.

Without strict_types

PHP coerces implicitly: double("3")double(3). Convenient, but hides bugs: double("hello")double(0) with no warning.

Type declarations

Parameter and return types: string, int, float, bool, array, callable, ?Type (nullable), Type|null, mixed, never, void.