The Proxy pattern controls access to another object. The client thinks it is talking to the real object, but in reality it is talking to an intermediary that can add caching, logging, lazy loading, access control or remote access. In Magento 2 Proxy is a built-in mechanism – every class with the \Proxy suffix in the DI container is exactly this pattern.

(more…)

A hash table is a data structure with O(1) for insert, lookup and delete on average. PHP uses it internally for arrays – every PHP array is effectively a hash map. But knowing how it works under the hood lets you write more efficient code and understand why certain operations are fast and others surprisingly slow.

(more…)

Checkout was freezing on the shipping selection step – the spinner kept spinning indefinitely. Customers could not proceed. The problem affected 100% of users on all browsers. Diagnosis time: 2 hours, fix time: 20 minutes.

(more…)

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.

(more…)

TOP