PHP: Guides and Practical Know-how | Page 16 | mironsoft Blog
PHP
-
Oct 7, 2025
PHP teams write the same boilerplate patterns every day: ViewModels with constructor property promotion, service interfaces with repository conventions, PHPDoc blocks for Magento classes. Live Templates and Postfix Templates in PhpStorm reduce these repetitive writing tasks to a few keystrokes, and can be shared as a team library.
-
Oct 4, 2025
PHP generators turn ordinary functions into iterators through the yield keyword, producing values one at a time instead of building an entire result in memory upfront. Instead of loading tens of thousands of CSV rows or a full database result set into an array, a generator delivers one row at a time and keeps memory usage constant regardless of dataset size. Anyone building large imports, exports, or streaming pipelines in PHP 8.4 will run into yield sooner or later.
-
Oct 3, 2025
Anyone who only drives Git from the terminal misses out on the most powerful tools PhpStorm offers for visual conflict resolution, interactive rebase, and precise commit selection. This guide shows how the entire Git workflow, from feature branches to cleanly split commits, runs directly inside the IDE.
-
Oct 3, 2025
Custom PHP attributes replace docblock annotations with a compiler-parsed, type-safe syntax: a class marked with #[Attribute] defines the structure, Attribute::TARGET flags restrict the allowed target, and a ReflectionClass reads the data at runtime, all without a fragile string parser for comments.
-
Oct 2, 2025
Many PHP APIs call themselves REST but are, on closer inspection, RPC calls wrapped in HTTP: one POST endpoint per action, always status code 200 regardless of outcome. Genuine RESTful API design in PHP requires resources instead of actions, correctly applied HTTP verbs, deliberate status codes and idempotency where it is expected, and none of that needs a framework to implement cleanly.
-
Oct 1, 2025
PHP arrays only accept integers and strings as keys, objects are silently rejected with an error or coerced into a useless string. SplObjectStorage closes that gap by allowing objects as keys, compared by identity. Using object metadata and graph traversal as examples, we show where this actually helps in day-to-day code.
-
Oct 1, 2025
A leap from PHP 5.6 straight to PHP 8 skips four major versions, each with its own breaking changes, removed functions and altered error handling. This article shows a multi-stage migration strategy with intermediate versions, a compatibility layer and a test safety net, instead of a risky single-step jump.
-
Oct 1, 2025
Testability is not created when the tests are written, but when the classes themselves are designed. Injecting dependencies, isolating side effects, and avoiding static calls builds code that can be tested without detours, no matter which test framework ends up being used. This article shows the design principles behind testable PHP code, beyond assertions and test runners.
-
-
Sep 29, 2025
PHP was originally invented as a templating language, long before it became the general purpose programming language it is today. That very origin makes plain PHP templating dangerously uncontrolled, since neither sandboxing nor automatic escaping are built in. We build a minimal engine with variable interpolation and auto-escaping, and show what mechanism actually powers Twig under the surface.