Tag: php
Loop Style Preferences
PHP 7.4+
Choose the clearest loop construct for the job: foreach for collections, for with index when position matters, while for condition-driven iteration.
1mo ago
Style beginner
Late Static Binding — PHP 5.3 Feature
PHP 5.3+
static:: (Late Static Binding, PHP 5.3) refers to the called class at runtime — unlike self:: which always refers to the class where the method is defined.
3mo ago
PHP intermediate
LLM Streaming Responses
PHP 8.0+
1
Receiving LLM output token-by-token as it is generated rather than waiting for the full response — dramatically improving perceived latency for users and enabling real-time displays of AI-generated content.
3mo ago
AI / ML intermediate
Lookahead & Lookbehind
PHP 5.3+
Zero-width assertions that match a position based on what precedes or follows it, without consuming characters — allowing conditions on surrounding context without including that context in the match.
3mo ago
Regex intermediate
Lazy Objects (PHP 8.4)
PHP 8.4+
PHP 8.4 native lazy object proxies defer initialisation until first access — enabling zero-cost dependency injection of services that may never be used in a request.
3mo ago
PHP advanced
Legacy Date Functions
PHP 5.0+
Using date(), mktime(), strtotime(), and date_create() instead of DateTimeImmutable — the legacy functions are mutable, timezone-unsafe, and cannot be easily mocked.
3mo ago
PHP intermediate
Lexing & Parsing
PHP 7.0+
1
Two stages of language processing — the lexer converts source text to tokens, the parser converts tokens to an Abstract Syntax Tree representing the program's structure.
3mo ago
Compiler advanced
Lines Too Long
Lines exceeding 120 characters force horizontal scrolling and break side-by-side diff views — PSR-12 recommends a soft limit of 120 and hard limit of no limit, but team conventions often enforce 120.
3mo ago
Style beginner
Linux Memory Management
1
How Linux allocates RAM — virtual memory, the page cache, swap, and the OOM killer — and what PHP developers need to know when PHP processes run out of memory.
3mo ago
Linux intermediate
Linux User & Group Management
2
Managing users and groups on Linux servers — useradd, usermod, passwd, groups — and best practices for PHP web server user isolation and privilege separation.
3mo ago
Linux intermediate
Log Levels Best Practices
PHP 5.0+
Using the correct severity level — ERROR, WARNING, INFO, DEBUG — ensures alerting triggers on real issues while debug noise stays suppressible in production.
3mo ago
Observability intermediate
Long Polling vs SSE vs WebSockets
PHP 5.0+
1
Long polling (HTTP hacks), SSE (one-way push over HTTP), WebSockets (full-duplex) — use SSE for server-to-client only, WebSocket for bidirectional.
3mo ago
Networking intermediate
Late Static Binding (static::)
PHP 5.3+
1
static:: refers to the class actually called at runtime rather than the class where the method is defined, enabling polymorphic static methods.
3mo ago
PHP advanced
Linux Processes
PHP 5.0+
1
Every running program is a process with a PID, memory space, and file descriptors — ps, top, kill, and signals are the essential tools for managing them.
3mo ago
Linux intermediate
list() / Short Array Destructuring
PHP 5.5+
1
Assigns array elements to variables in a single expression — list($a, $b) or the shorthand [$a, $b] = $array.
3mo ago
PHP beginner
Local File Inclusion (LFI)
PHP 5.0+
1
A PHP include/require driven by user input that can load arbitrary local files, sometimes leading to code execution.
CWE-98 OWASP A3:2021
3mo ago
Security intermediate
7.5
Locale-Aware Formatting
PHP 5.3+
Formatting numbers, currencies, and dates according to locale conventions — 1,234.56 in en-US is 1.234,56 in de-DE, and currency symbols and date formats vary by locale.
3mo ago
i18n intermediate
Lazy Objects (PHP 8.4)
PHP 8.4+
PHP 8.4 native lazy objects defer object initialisation until first property access — previously requiring proxy libraries, now built into the engine via ReflectionClass.
PHP advanced