PHP: Guides and Practical Know-how | Page 10 | mironsoft Blog
PHP
-
Dec 14, 2025
A classic PHP-FPM request automatically frees all its memory at the end, while a Swoole or RoadRunner worker lives on through thousands of requests within the same process. That exact difference turns static state, forgotten closures and growing caches into a real memory leak that slowly eats up available memory over hours of operation.
-
Dec 13, 2025
Currying breaks a multi-argument function into a chain of single-argument functions, partial application freezes some arguments upfront. Both techniques can be rebuilt in PHP 8.4 without any external library, using closures, and they cut repeated parameters down to a minimum.
-
-
Dec 12, 2025
A single GraphQL mutation looks atomic from the outside, but often hides multiple write steps internally, payment capture, inventory reservation, shipment order. Transactional mutations in GraphQL must secure exactly this multi-step nature, using unit of work, idempotency keys and the saga pattern for distributed consistency.
-
Dec 11, 2025
The automatic property-by-property comparison of assertEquals() fails for value objects with their own business definition of equality. assertObjectEquals() and custom comparator classes solve this by using the class's own real comparison logic.
-
Dec 7, 2025
Anyone who copies the same helper code into several projects eventually loses track of which version runs where. Your own Composer package solves this: one composer.json, one PSR-4 namespace, one version number per Git tag, and a single source of truth. This article walks the complete path from the first directory structure through Git tags to registration on Packagist, with real, traceable PHP 8.4 code.
-
Dec 5, 2025
Anyone who calls functions and constructors with many optional parameters knows the long lists of true, false and null whose meaning only becomes clear by looking at the signature. Named arguments solve this problem: the parameter name becomes visible right at the call site, order no longer matters, and unused defaults never have to be spelled out artificially.
-
Dec 5, 2025
A PHP attribute is just metadata until someone reads it. Only ReflectionAttribute makes attributes usable at runtime, by extracting arguments, creating real instances and filtering by type. Understanding how ReflectionAttribute handles getArguments(), newInstance() and repeatable attributes lets you build validation, routing and serialization systems that need no external configuration files at all.
-
Dec 2, 2025
Switching between editor and terminal to run Composer or npm costs focus and context. PhpStorm can integrate Composer, Node.js, npm and Yarn directly, with autocompletion for composer.json and package.json, script buttons and a full output view right in the IDE.
-
Dec 1, 2025
When PHPStan is green locally but red in the CI pipeline, it comes down to a configuration mismatch. The problem is solvable: align pre-commit hooks, PhpStorm quality gates and the CI pipeline so that what runs locally checks exactly what the pipeline checks, no push that fails right out of the gate.