PHP 8.1 and 8.2 brought named arguments and first-class callables – two features that change the way code is written. Named arguments eliminate “argument order confusion” and improve the readability of function calls with many parameters. First-class callables replace Closure::fromCallable() and [$this, 'method'] with the clean func(...) syntax.
A product showed “In Stock” on the product page despite actually being out of stock. Customers placed orders for a product that could not be fulfilled. The error only appeared when creating a shipment. The problem affected configurable products with MSI. Fix time: 4 hours.
DDEV is a convenient tool but not the only way. Your own Docker Compose stack gives full control: exactly the service versions you need, custom network, CI/CD integration, deployable to any server without changes. I show a minimal but complete stack for Magento 2 with PHP 8.4, MariaDB 10.6, Redis, OpenSearch and nginx.
A multi-store shop (5 stores, 3 currencies) started showing wrong prices – the euro price appeared on the PLN store and vice versa. The problem appeared after adding a new store and only affected products with price rules. Fix time: 6 hours.
The Decorator pattern allows you to dynamically add behaviour to an object without modifying its class and without inheritance. Each decorator wraps the original object and extends or modifies its behaviour. In PHP and Magento 2 it is one of the most frequently used patterns – Magento’s plugin system is effectively a Decorator implemented by the DI framework.
An administrator account was locked after a dictionary attack – 10,000 login attempts in one hour. Magento locks an account after 6 failed attempts for 30 minutes. Problem: the attacker kept resetting the counter by changing IP, while the real admin could not log in. Fix time: 1 hour.
Union-Find (Disjoint Set Union) is a data structure for managing disjoint sets. It supports two operations in nearly O(1) time: checking whether two elements belong to the same set (Find) and merging two sets (Union). The algorithm appears in graph problems, cycle detection and element grouping. In Magento 2 it is useful for merging duplicate customers and products.
Magento 2 cron stopped working – over 50,000 unexecuted jobs were backed up in the cron_schedule table. Transactional emails were not going out, indexers were not updating, pricing rules were not refreshing. The shop worked normally for customers but was frozen “from the inside”. Fix time: 3 hours.
PHP 8.3 doprecyzował i rozszerzył kilka funkcji które były już w 8.1 i 8.2. Readonly properties dostały nowe możliwości, json_validate() zastąpiło powszechny hack z json_decode + sprawdzeniem błędu, a nowe funkcje tablic i typowanie klas wbudowanych zamknęły kilka długo otwartych luk. Pokażę zmiany które mają realny wpływ na codzienne pisanie kodu w Magento 2.
The shop was running normally, but conversion suddenly dropped 40% in a single day. Google Analytics showed traffic at normal levels. The problem was invisible to the naked eye – only at a specific screen size did checkout buttons overlap and become unclickable. Diagnosis time: 3 hours, fix time: 30 minutes.
