PHP: Guides and Practical Know-how | Page 17 | mironsoft Blog
PHP
-
Sep 28, 2025
A message text alone is not enough for a client to translate an error or drive retry logic. Anyone standardizing GraphQL error codes needs a central catalog of consistent extensions.code values that maps domain exceptions unambiguously onto stable, documented error codes.
-
Sep 27, 2025
Running unserialize on untrusted input such as cookies, session data, or API payloads opens the door to PHP Object Injection and dangerous gadget chains that abuse magic methods like wakeup and destruct to execute arbitrary code. This article explains the mechanics, shows safer alternatives like json_decode, and covers proven deserialization patterns for production PHP and Magento applications.
-
Sep 25, 2025
No single tool masters every aspect of a modern deployment stack. Bash as glue code connects PHP scripts, SQL dump workflows, Docker build chains and Git hooks into one coherent automation system, with robust exit code handling, targeted data forwarding and clear error escalation that surfaces problems early.
-
Sep 21, 2025
Anyone running custom PHP applications without Symfony or Laravel has to build CSRF protection themselves. With random_bytes for token generation, hash_equals for constant time comparison and a clean session binding, robust CSRF protection can be built in a few lines of PHP, without any third party dependency.
-
Sep 16, 2025
A closure doesn't automatically carry its definition context with it when it comes to visibility. Closure::bind and bindTo let you change a closure's $this context and its scope for visibility checks explicitly, even after the fact. We show how that works in detail and where private access from closures genuinely pays off in practice.
-
Sep 15, 2025
Since PHP 8.0, the JIT compiler translates hot opcode paths into native machine code at runtime, but the effect depends entirely on the workload: numerical computation, image processing, and parsing large volumes of data show measurable runtime gains, while classic, database-heavy web applications barely benefit because wait time on syscalls dominates there. This article explains the architecture of Function JIT and Tracing JIT, the relevant opcache.jit configuration values, and a solid benchmark methodology to measure the actual effect in your own project instead of guessing.
-
Sep 14, 2025
Anyone who keeps typing phpcs, phpstan or bin/magento cache:flush into the terminal loses time and focus. PhpStorm lets you integrate any Composer script, any shell command and any Docker wrapper script as a button directly in the IDE: clickable, with output in the Run window and optionally triggerable with a keyboard shortcut.
-
Sep 12, 2025
"Segmentation fault (core dumped)" in the log marks the end of the investigation for many teams instead of the beginning. Yet a correctly enabled core dump combined with gdb and coredumpctl almost always yields a complete backtrace down to the exact line of code. This guide shows how to configure core dumps correctly on Linux, read backtraces, and systematically narrow down typical causes such as faulty PHP extensions.
-
-
Sep 10, 2025
Direct calls to new DateTime() or time() are the classic reason time-dependent logic is hard to test. A custom Clock abstraction fixes the problem at the root and lets you set fixed points in time inside PHPUnit tests.