PHP: Guides and Practical Know-how | Page 24 | mironsoft Blog
PHP
-
May 29, 2025
Green tests do not mean the code is safe. In many teams, tests only get a superficial look in review, whether they run, whether coverage numbers add up. Yet it is entirely different criteria that decide whether a PHPUnit test provides real protection against regressions or merely fakes safety.
-
May 28, 2025
Hand-written PHPDoc blocks are almost guaranteed to go stale as soon as a signature changes. PhpStorm can infer docblocks from the actual code, flag outdated comments, and create the foundation PHPStan needs to analyze reliably.
-
May 26, 2025
PhpStorm ships with two AI tools of very different reach: AI Assistant, which assists inside the editor, and Junie, which takes on tasks on its own. Anyone using both for code reviews and refactoring suggestions should understand their limits around context size and code confidentiality before feeding production PHP code through them.
-
May 26, 2025
An ordinary PHP array is internally an ordered hash table with considerable overhead per element, even when only sequential integer keys are used. SplFixedArray, SplStack, SplQueue and SplHeap provide specialized, memory-efficient data structures that noticeably reduce that overhead for large, clearly structured data volumes.
-
May 21, 2025
A PHP array can serve as a stack, a queue, and almost anything else, that flexibility is its greatest strength and, at the same time, its biggest weakness. The SPL ships SplStack, SplQueue, and SplPriorityQueue, specialized structures that not only express intent more clearly in code but also outperform array_shift and array_push under the right conditions. We show when the switch actually pays off.
-
May 20, 2025
The same three dots mean something different in a function signature than they do at a function call, and if you don't keep those two apart, definition and usage get confused fast. We cover how variadic parameters and the spread operator at a call site interact, how named arguments combine with variadics, and where wrapper functions and fluent builders with a variable argument count actually pay off in practice.
-
May 16, 2025
Once more than one php-fpm process is running, the default file-based session storage quickly becomes a problem, at the latest once you scale horizontally across multiple servers. SessionHandlerInterface offers exactly six methods to store session data in Redis, a database, or any other backend instead, without any framework at all. This article walks through the implementation in detail, including the locking strategy that protects parallel requests for the same session from data loss.
-
-
May 15, 2025
A freshly installed PHPStorm without a checklist costs hours: wrong interpreter, too much indexed vendor bulk, no Xdebug, no run configurations. This checklist covers all the critical settings, in the order that matters most for Docker Magento projects.
-
May 13, 2025
As soon as a class uses two traits with same-named methods, PHP reports a fatal error unless the conflict is resolved explicitly. insteadof decides the winner, as assigns alias names and changes visibility. This article shows both operators in detail and where trait conflicts typically arise in real projects.