PHP: Guides and Practical Know-how | Page 5 | mironsoft Blog
PHP
-
Mar 1, 2026
Seeing static analysis and code style checks for the first time in the CI pipeline is too late. PHPStan, Psalm and PHP_CodeSniffer can be integrated directly into PhpStorm, as External Tools, Run Configurations and File Watchers, so feedback arrives the moment you save, not only at the pull request.
-
Feb 25, 2026
Anyone who treats enums as nothing more than a type-safe list of constants is missing PHP's real strength: enums with interfaces implement genuine object-oriented behavior per case, replace match blocks scattered across the caller code with a single method inside the enum, and force new cases to surface through the compiler instead of through grep searches across the project.
-
Feb 24, 2026
Not every question about an object's structure needs ReflectionClass. PHP ships a set of lightweight introspection functions, from get_class through instanceof to is_callable, that avoid the overhead of the Reflection API and are entirely sufficient for most everyday type checks.
-
Feb 23, 2026
The EMFILE error, reported as "Too many open files", is rarely a coincidence and almost never a pure capacity issue. Usually an application opens connections, files, or sockets and never closes them again. This guide shows how to use lsof, the /proc/pid/fd directory, and targeted monitoring to find out which code path is leaking file descriptors and how to configure the limits correctly without papering over the actual leak.
-
Feb 22, 2026
Writing GraphQL queries without schema autocompletion means keeping field names in your head and only seeing errors at runtime. PhpStorm with the GraphQL plugin validates queries statically against the schema, completes fields and arguments, and lets you fire HTTP requests directly from the IDE, without Postman or a browser devtool.
-
Feb 15, 2026
PHP 8 attributes have largely replaced YAML and XML in Symfony configuration. Symfony 7 brings dozens of PHP attributes for routing, dependency injection, events, caching, security and request mapping, all with semantics identical to the previous configuration formats, but considerably more compact and placed directly on the code.
-
Feb 14, 2026
Rector automated refactoring replaces manual search and replace during PHP version upgrades with AST-based code rewriting: constructor property promotion, readonly properties, match expressions and the nullsafe operator are applied mechanically and repeatably across an entire codebase, including dry-run preview, custom rules and CI integration against regressions.
-
Feb 14, 2026
Switching randomly between array_map, foreach and generators on large datasets risks unnecessary memory usage and hard to predict runtimes. This article compares the most important array functions in PHP 8.4 with real benchmarks, shows when generators with yield make the decisive difference, and provides clear decision rules for everyday project work.
-
Feb 12, 2026
Feeding unchecked user input into shell_exec, exec, or system hands attackers the keys to full control over your server. This article shows how command injection arises in PHP applications, where escapeshellarg and escapeshellcmd genuinely help and where they fall short, and why native PHP libraries and the Symfony Process component are the most robust fix.
-
Feb 11, 2026
strict_types turns off PHP's automatic, silent type conversion for the current file: a string passed to an int parameter, a float passed to an int parameter, or a wrong return type all trigger an immediate TypeError instead of being quietly converted to another type, which surfaces bugs years earlier, right at the call site instead of somewhere deeper in the code.