PHP: Guides and Practical Know-how | Page 20 | mironsoft Blog
PHP
-
Aug 4, 2025
A good Magento workflow depends heavily on using the right commands. In a Mark Shust setup, the wrappers in the `bin/` directory are the clean way to handle Magento, Composer, logs, debugging, the database and code quality.
-
Aug 3, 2025
Higher Order Functions treat functions like any other value: they get passed around, returned, and composed at runtime. In PHP 8.4 this replaces loops, conditionals and boilerplate with clearly named, reusable building blocks, without needing an extra framework.
-
Aug 2, 2025
Anyone who blindly treats every collaborator as a Mock loses the semantic expressiveness of their tests. Stub, Fake, Spy, Mock and Dummy have clearly defined roles, and whoever confuses these roles ends up writing tests that hide bugs instead of surfacing them.
-
Aug 1, 2025
PHP 8.4 bundles an unusually high number of language features into a single release: from property hooks to four new array functions to a rewritten DOM API. This overview places every one of the new PHP 8.4 features in context, shows real code, and flags what can actually break when upgrading to PHP 8.4.
-
Jul 28, 2025
Hand-written test data like 'Test Name' or 'test@test.com' hides real bugs because it never reflects the diversity of real input. The Faker library generates realistic names, addresses, and prices while staying fully reproducible with fixed seeds.
-
Jul 27, 2025
Legacy code is code without tests, and it cannot be changed safely without tests. The way out of this dilemma begins with characterization tests: tests that document the actual behavior, not the desired one. Introduce seams, break static dependencies and extract classes step by step, without changing a single line of production logic before the first test is green.
-
Jul 26, 2025
Message queues decouple PHP applications from slow or unreliable neighboring systems and shift work into asynchronous worker processes. Once you understand how acknowledgments, prefetch and dead letter queues interact, you can drive message queues from PHP so that messages are neither lost nor processed twice.
-
Jul 26, 2025
A fluent interface is supposed to make code more readable, yet in practice it often ends up as a chain that is hard to debug and has no clear error path. With return $this, careful type safety between self and static, and immutability, you can build a fluent interface that actually makes method chaining safe instead of just making it look elegant.
-
Jul 25, 2025
A clear versioning strategy decides whether an internal Symfony bundle can be confidently updated through composer update or causes surprises with every update. This article shows how to consistently apply semantic versioning, how to detect breaking changes and how to design deprecation paths for smooth migrations.
-
Jul 23, 2025
A single call to htmlspecialchars() is often mistaken for complete XSS protection, yet safe output encoding always depends on where the value ends up: HTML body, HTML attribute, JavaScript string and URL each require their own escaping rules, and mixing them up leaves open exactly the gap that was supposed to be closed.