Glossary

Functional Programming

Functional programming (FP) is a paradigm where a program is built from pure functions, avoiding mutable state and side effects. A function's result depends solely on its arguments.

Key concepts

Practical use in PHP

$prices = [100, 200, 300];
$discounted = array_map(fn($p) => $p * 0.9, $prices);
$total = array_reduce($discounted, fn($sum, $p) => $sum + $p, 0);

FP vs OOP

These are not competing approaches: modern PHP and JavaScript support both. FP is especially useful for data processing, transformations, and pipelines.