PHP: Guides and Practical Know-how | Page 4 | mironsoft Blog
PHP
-
Mar 14, 2026
A custom query builder replaces fragile string concatenation with an object that assembles SQL expressions step by step, in a type safe and testable way. Understanding how a query builder works internally makes it easier to use finished solutions like Doctrine or Laravel Eloquent more deliberately, and to know when a custom build actually makes sense.
-
Mar 13, 2026
The foundation of all Magento architecture: constructor injection, di.xml, preferences, virtual types, shared objects and clean testing with mocks, explained in full.
-
Mar 13, 2026
Promises encapsulate the result of an asynchronous operation before that result even exists, while a Deferred object provides control over resolution and rejection from the outside. Anyone who understands the three states of a promise, the rules of chaining and the common combinators can structure complex asynchronous workflows in PHP, whether with ReactPHP, Amp or a custom minimal implementation.
-
Mar 7, 2026
Doctrine ORM 3 replaces proxy classes with Lazy Ghost Objects, changes EntityManager methods, and tightens mapping for embeddables. Teams that know these breaking changes before migrating and follow a clear checklist can bring existing Symfony projects onto the new ORM version without production downtime.
-
Mar 6, 2026
Anyone still running PHP 7.4 in production is operating a version without security updates on a codebase that barely any modern Composer package still supports. Migrating PHP 7 to PHP 8 is technically manageable once you understand the type system changes, removed functions, and string comparisons, and once you approach it systematically with PHPStan and Rector instead of improvising.
-
Mar 4, 2026
The ReactPHP event loop is the heart of every asynchronous PHP application built on React: a single thread that manages timers, watches file descriptors and runs callbacks in a clear order. Anyone who understands the tick cycle, the timer queue and how streams and promises interact writes code that truly does not block, instead of just looking like it does.
-
Mar 4, 2026
graphql-php by Webonyx is the PHP reference implementation of the GraphQL specification and the foundation of virtually every larger PHP GraphQL solution, from Lighthouse to standalone APIs built from scratch. Anyone using graphql-php directly has to decide early on: define the schema via an SDL file, or describe types as PHP classes in code. That decision shapes maintainability, IDE support and team workflow for the entire project lifetime.
-
-
Mar 2, 2026
RFC 7807 defines a single, predictable JSON format for error responses: type, title, status, detail and instance. This article shows how a PHP API implements this format consistently, from the Problem Details class through the global exception handler to business validation errors with their own extension fields.
-
Mar 2, 2026
A Content Security Policy drastically reduces the risk of cross site scripting, yet many PHP applications either skip it entirely or copy a rigid policy straight from a tutorial. Generating the policy directly from PHP, with per request nonces and a controlled rollout through report only mode, gives you a protection mechanism that fits the application instead of blocking it.