Iterator and Generator are two related but distinct mechanisms in PHP. Iterator is a GoF pattern that gives sequential access to a collection without exposing its internal structure. Generator is a PHP language feature that creates an Iterator using yield – without storing all values in memory at once. I show both, benchmark the memory difference, and apply them to large-scale Magento product processing.

(more…)

Extension Attributes are Magento 2’s mechanism for extending existing entities (Product, Order, Customer) without modifying core tables. They participate in the REST API automatically and can carry any data type. Most tutorials show a simple string attribute. I show a complete implementation with batch loading (fixing N+1), REST API exposure with serialisation, and unit tests.

(more…)

PHP 8.5 RC1 is out and the pipe operator is in it. After weeks with real Magento 2 module code using the RC, I can report what the pipe operator is genuinely good for, where it creates surprises, and confirm that readonly property inheritance works exactly as the RFC described. This is practical experience, not theory.

(more…)

DDEV out of the box is fast to set up but the defaults leave performance on the table. Mutagen file sync, custom services, project hooks, and shared team configuration in version control reduce friction for everyone on the project. I show the advanced DDEV setup I use on large Magento 2 projects with multiple developers.

(more…)

TOP