Glossary
Web Developer Dictionary
Визначення технічних термінів з PHP, DevOps, MySQL та AI — з прикладами коду та поясненнями простою мовою.
228
terms
27
letters
F
Factory Pattern
Factory is a pattern that encapsulates object creation logic. Instead of new ConcreteClass() scattered throughout the code, you call a factory that decides which class to instantiate. The client code does not know how the object is created.VariantsSimple Factory — a static method returning the right object based on a parameterFactory Method — a base class defines the creation interface; subclasses override the concrete implementationAbstract Factory — a factory of factories: creates families of related objectsWhen usefulThe object type depends on runtime conditions or configurationComplex initialisation logic needs to be isolated in one placeEasy to swap the implementation without changing client code
Feature Flag
A feature flag (or feature toggle) is a mechanism for enabling or disabling functionality without a deploy. The code for a new feature is present in production, but activated only for selected users or based on a configuration condition.Use casesProgressive rollout — start with 1% of users, then 10%, then 100%A/B testing — different UI versions for different groupsTrunk-Based Development — unfinished code in main, hidden behind a flagKill switch — quickly disable a problematic feature without rolling back the deployImplementationSimple flags — environment variables or config. Complex scenarios — dedicated services: LaunchDarkly, Flagsmith, GrowthBook, Unleash. These support targeting by user_id, country, plan, and more.Technical debtA feature flag is a temporary construct. Remove flags after full rollout, or the codebase will turn into a maze of conditionals.
Fibers (PHP 8.1)
Fibers are concurrency primitives introduced in PHP 8.1. A Fiber is a lightweight "thread" that you control manually: suspend it and resume it. The foundation for async PHP without extensions.
How it works
$fiber = new Fiber(function (): void {
$value = Fiber::suspend('first'); // pause, return 'first'
echo "Resumed with: $value\n";
});
$result = $fiber->start(); // 'first'
$fiber->resume('hello'); // Resumed with: hello
Fiber vs Generator
Generator — an iterator with yield. One-directional data flow outward
Fiber — bidirectional: can both receive and send values. A full coroutine
In practice
Fibers are a low-level primitive. Application developers typically work through libraries (ReactPHP, Amp, Swoole) rather than directly. But they are the foundation on which those libraries build async/await style in PHP.
Flexbox (CSS)
Flexbox (Flexible Box Layout) is a CSS layout model for aligning items in a single row or column. It solves classic layout challenges: vertical centring, even distribution, responsive nav bars.
Key container properties
.container {
display: flex;
flex-direction: row | column; /* axis */
justify-content: flex-start | center | space-between | space-around;
align-items: stretch | center | flex-start | flex-end;
flex-wrap: nowrap | wrap; /* wrap to next line */
gap: 16px; /* space between items */
}
Item properties
.item {
flex: 1; /* grow + shrink + basis = equal distribution */
flex-grow: 2; /* take twice as much free space */
align-self: center; /* individual alignment */
order: -1; /* reorder without changing HTML */
}
Flexbox vs Grid
Flexbox is one-dimensional (row OR column). CSS Grid is two-dimensional (rows AND columns simultaneously). For nav bars and card lists — Flexbox. For complex page layouts — Grid.
Foreign Key
A foreign key is a database constraint that guarantees referential integrity between tables. A column in a child table may only contain values that exist in the parent table. The database will reject any insert or update that would violate this relationship.DeclarationCREATE TABLE orders (
id INT PRIMARY KEY,
user_id INT,
FOREIGN KEY (user_id) REFERENCES users(id)
ON DELETE CASCADE
ON UPDATE RESTRICT
);ON DELETE / ON UPDATE strategiesCASCADE — deleting a parent also deletes all child recordsRESTRICT / NO ACTION — prevent deletion of a parent if children existSET NULL — set the child field to NULLSET DEFAULT — set to the default valuePerformanceMySQL/InnoDB automatically indexes FK columns. On large tables, FK validation on every insert adds ~5–10% overhead.
Full-Text Search
Full-text search is searching over natural language text with support for relevance, morphology, stop words, and result ranking. Unlike a LIKE search: LIKE '%php%' ignores morphology and does not rank; full-text search does both.MySQL FULLTEXTMySQL supports FULLTEXT indexes for MyISAM and InnoDB. Two modes: BOOLEAN (operators +, -, *) and NATURAL LANGUAGE (relevance ranking).MATCH(title, body) AGAINST('opcache php' IN BOOLEAN MODE)Elasticsearch and OpenSearchFor serious search — dedicated Lucene-based engines. They support stemming, faceted search, synonyms, typo-tolerance, and geo-search. Data is synchronised from the main DB via events.
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 conceptsPure function — given the same arguments, always returns the same result; does not modify external stateImmutability — data is not mutated; new data is returnedHigher-order functions — functions that take or return other functions (map, filter, reduce)Composition — combining simple functions into more complex onesPractical 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 OOPThese are not competing approaches: modern PHP and JavaScript support both. FP is especially useful for data processing, transformations, and pipelines.