Tag: php8
🤖 AI Guestbook — #php8 educational data only No AI pings for this tag yet…
No AI pings for #php8 yet. Each term page has a 📡 endpoint.
Database Query Result Streaming PHP 8.0+
Processing large result sets row-by-row without loading the entire dataset into memory - essential for PHP CLI scripts handling millions of rows.
6d ago
database intermediate
Attributes #[] Replacing Docblock Annotations PHP 8.0+
PHP 8.0 native attributes (#[Route('/home')]) replace fragile DocBlock @annotations — they're syntactically valid, parseable without reflection hacks, and supported by IDEs and static analysis.
2mo ago
php intermediate
create_function() — The Dynamic Code Smell PHP 4.0+
create_function() created anonymous functions from strings — deprecated PHP 7.2, removed PHP 8. It used eval() internally, risked code injection, and was always replaceable with proper closures.
2mo ago
php intermediate
each() & list() — Deprecated Iteration PHP 3.0+
each() was deprecated in PHP 7.2 and removed in PHP 8 — replace while(list($k,$v)=each($arr)) with foreach. list() itself is still valid as [] destructuring.
2mo ago
php beginner
JIT Compiler Introduction (PHP 8.0) PHP 8.0+
PHP 8.0's JIT (Just-In-Time) compiler compiles hot bytecode to native machine code at runtime — significant gains for CPU-bound tasks, minimal gains for typical web requests.
2mo ago
php advanced
match Expression (PHP 8.0) PHP 8.0+
PHP 8.0's match is a stricter switch — uses strict (===) comparison, each arm is an expression (not statements), returns a value, and throws UnhandledMatchError if no arm matches.
2mo ago
php beginner
Migrating from PHP 7 to PHP 8 PHP 7.0+
PHP 7→8 migration: fix type coercion changes (stricter), remove deprecated functions (each(), create_function()), update match/constructor promotion, check third-party compatibility.
2mo ago
php intermediate
Named Arguments (PHP 8.0) PHP 8.0+
PHP 8.0 named arguments let you pass values by parameter name — skipping optional params, self-documenting calls, and enabling out-of-order argument passing.
2mo ago
php beginner
Opaque Objects & GdImage/CURLHandle PHP 8.0+
PHP 8.0 replaced resource types (gd, curl, xml) with opaque objects — GdImage, CurlHandle, XMLParser — improving type safety and OOP integration.
2mo ago
php intermediate
PHP 8 — Key Features PHP 8.0+
PHP 8.0–8.4 introduced match expressions, named arguments, union types, nullsafe operator, fibers, enums, readonly properties, first-class callables, and a JIT compiler — the most significant evolution of the language since PHP 5.
2mo ago
php intermediate
match() Default Arm vs No Default PHP 8.0+
match() without a default arm throws UnhandledMatchError if no arm matches — unlike switch, which silently falls through.
2mo ago
php intermediate
str_contains / str_starts_with / str_ends_with PHP 8.0+
PHP 8.0 added str_contains(), str_starts_with(), and str_ends_with() — replace strpos() !== false patterns with these readable alternatives.
2mo ago
php beginner
String Offset Curly Brace Syntax PHP 5.0+
Using $str{0} to access string characters by index — deprecated since PHP 7.4 and removed in PHP 8.0; use square bracket syntax $str[0] instead.
2mo ago
php beginner
The Password Hashing Competition winner (2015) — a memory-hard algorithm that resists GPU and ASIC brute-force attacks better than bcrypt.
OWASP A2:2021
2mo ago
security intermediate
Array Unpacking with String Keys (PHP 8.1) PHP 8.1+
PHP 8.1 allows the spread operator to unpack arrays with string keys — previously only integer-keyed arrays could be spread.
2mo ago
php intermediate
Attributes / Annotations (PHP 8.0) PHP 8.0+
Native structured metadata attached to classes, methods, properties, and parameters using #[AttributeName] syntax.
2mo ago
php intermediate
Built-in PHP Attributes PHP 8.0+
PHP 8.0+ ships built-in attributes — #[Deprecated], #[Override], #[AllowDynamicProperties], #[SensitiveParameter] — for tooling and runtime hints.
2mo ago
php intermediate
Constructor Property Promotion (PHP 8.0) PHP 8.0+
Declare and assign class properties directly in constructor parameters using visibility modifiers, eliminating boilerplate.
2mo ago
php beginner
Disjunctive Normal Form Types (PHP 8.2) PHP 8.2+
DNF types combine intersection and union types with parentheses — (Countable&Iterator)|null — filling gaps in PHP 8.0/8.1's type system.
2mo ago
php advanced
Enum Methods, Interfaces & Constants (PHP 8.1) PHP 8.1+
PHP 8.1 enums support methods, interface implementation, constants, and static factory methods — making them full-featured types, not just value lists.
2mo ago
php intermediate