PHPPHP

PHP glossary – key terms explained

Attribute

Structured metadata in the form #[Name] that can be read via reflection (since PHP 8.0).

Autoloading

Automatic loading of classes on first use, without manual require lines.

Composer

Package manager for PHP: installs dependencies from composer.json into vendor/ and generates the autoloader.

CSRF

Cross-site request forgery: a foreign site triggers an unwanted action using your session; protection via a token.

Enum

A type with fixed, named cases (since PHP 8.1), optionally with a value (backed) and methods.

Laravel

Popular PHP framework with routing, ORM (Eloquent), templates (Blade) and queues.

Named Argument

An argument passed by name (f(gruss: "Hi")), independent of the order (since PHP 8.0).

Namespace

A namespace that groups classes and avoids name conflicts, e.g. AppService.

OPcache

Extension that keeps compiled bytecode in memory so scripts are not re-parsed on every request.

Packagist

The central directory for Composer packages (packagist.org).

PDO

PHP Data Objects: a unified, database-independent interface with prepared statements.

PHP-FPM

FastCGI Process Manager: the process that executes PHP scripts for web servers like nginx or Apache.

Prepared Statement

Precompiled SQL statement with placeholders; values are passed separately and are thus protected against SQL injection.

PSR

PHP Standards Recommendations: recommendations by the PHP-FIG, e.g. PSR-4 (autoloading) and PSR-12 (code style).

Session

Server-side storage per visitor; the browser only holds the session ID in a cookie.

SQL Injection

Attack in which input is interpreted as SQL code because it was built into a query string.

strict_types

declare(strict_types=1); turns off the silent type conversion for function calls.

Superglobal

Predefined array that is available everywhere: $_GET, $_POST, $_SERVER, $_SESSION, $_COOKIE, $_FILES.

Trait

Reusable building block of code that is included in classes via use – a substitute for multiple inheritance.

Type Juggling

PHP automatic type conversion in comparisons and calculations. With === and strict_types you avoid surprises.

XSS

Cross-site scripting: injecting JavaScript into a page via unescaped user input.