PHP / Magento Dev Blog

  • Publikacje
  • O autorze
  • Kontakt

100th post – retrospective: 6.5 years, PHP 7.2 to 8.4, Magento 2.2 to 2.4.8

by Henryk Tews / Tuesday, 18 February 2025 / Published in Magento 2, PHP

This is the 100th post on this blog. I started writing in July 2018, documenting what I was learning and building. 6.5 years, PHP 7.2 through 8.4, Magento 2.2 through 2.4.8, 100 posts. A retrospective – what changed, what stayed the same, and what I would tell myself in 2018 if I could.

PHP: from 7.2 to 8.4

PHP version Release year Key feature I use daily
7.2 2017 object type hint, sodium
7.3 2018 flexible heredoc, array_key_first/last
7.4 2019 typed properties, arrow functions
8.0 2020 match, named arguments, union types, JIT
8.1 2021 enums, readonly, fibers
8.2 2022 readonly classes, DNF types
8.3 2023 typed constants, json_validate(), array_find()
8.4 2024 property hooks, asymmetric visibility, lazy objects

PHP in 2024 is a genuinely modern language. The type system has caught up with TypeScript for most practical purposes. PHPStan at level 8 catches errors that would have required runtime failures to discover in 2018. Constructor promotion eliminates half the boilerplate of value object classes. Enums replaced class-full-of-constants everywhere.

Magento 2: from 2.2 to 2.4.8

Magento 2.2 (2017) - GraphQL not yet, MySQL search, PHP 7.1
Magento 2.3 (2019) - GraphQL added, MSI, Page Builder, PHP 7.3
Magento 2.4 (2020) - Elasticsearch required, PHP 7.4, PWA Studio, 2FA
Magento 2.4.4 (2022) - PHP 8.1, OpenSearch first supported
Magento 2.4.6 (2023) - PHP 8.2 support, performance improvements
Magento 2.4.7 (2024) - PHP 8.3, security hardening
Magento 2.4.8 (2025) - PHP 8.4, OpenSearch required, ES deprecated

What changed most in Magento: the search stack (MySQL -> Elasticsearch -> OpenSearch), the frontend (Luma -> Hyvä), and the PHP version support cycle (now consistently on current PHP). What did not change: the DI container architecture, Service Contracts, EAV. The core patterns from 2018 still apply in 2025.

What I would tell myself in 2018

<?php

// 1. WRITE TESTS FROM THE START
// Every module without tests costs 3x as much to maintain.
// PHPUnit + mocking Magento's service contracts = easy and fast.

// 2. STRICT TYPES EVERYWHERE, IMMEDIATELY
// One line, zero cost, catches an entire class of bugs:
// declare(strict_types=1);
// I spent months debugging type coercion bugs that this would have caught instantly.

// 3. LEARN THE DI CONTAINER PROPERLY
// Not just "inject things in constructor" but:
// - Virtual Types (zero PHP code)
// - di.xml arguments
// - Plugins vs Preferences vs Observers - when each is appropriate
// This knowledge multiplied my productivity more than anything else.

// 4. READ MAGENTO SOURCE CODE
// The best Magento documentation is the source code itself.
// vendor/magento/module-*/Model/**/*.php - read it, understand it.
// Most "how do I do X" questions are answered by finding how Magento does X.

// 5. STATIC ANALYSIS IS NOT OPTIONAL
// PHPStan from day one, raise the level gradually.
// "I'll add it to the CI pipeline later" means "never".

Topics covered in 100 posts

Category Posts Examples
Magento 2 ~35 DI, plugins, checkout, MSI, B2B, indexers
PHP language ~25 7.2 through 8.4, typing, enums, hooks
Design Patterns ~20 All 23 GoF + CQRS, Event Sourcing
Algorithms ~12 Sorting, graphs, trees, probabilistic structures
Environments ~8 DDEV, Docker, Blackfire, OpenTelemetry

The constant across 6.5 years

What did not change: the value of understanding fundamentals. PHP’s type system improved but the principle of explicit over implicit was always right. Design patterns changed names across frameworks but the problems they solve are the same. SOLID principles from 1994 are as relevant today as in 2018. The tools change; the craft is the same.

What is next

The blog continues at two posts per month. Topics on the list: deeper Hyvä customisation, FrankenPHP in production, PHP 8.5 when it ships, AI-assisted code generation workflows, Magento performance deep-dives. The same format: merytoryczne, technical, code-first.

Summary

100 posts, 6.5 years, one consistent goal: document what actually matters in PHP and Magento 2 development. The technology stack evolved dramatically. The fundamentals – types, tests, SOLID, patterns, performance – remained the north star. If these posts saved someone a few hours of debugging or clarified a confusing Magento mechanism, the time writing them was well spent.

About Henryk Tews

What you can read next

Strategy pattern in PHP – and how Magento 2 uses it in pricing
PHP 7.2 – object type hint, sodium instead of mcrypt, deprecations
Xdebug – configuration, PHPStorm, debugging Magento plugins

© 2026 Created by

TOP
Zarządzaj zgodą
Aby zapewnić jak najlepsze wrażenia, korzystamy z technologii, takich jak pliki cookie, do przechowywania i/lub uzyskiwania dostępu do informacji o urządzeniu. Zgoda na te technologie pozwoli nam przetwarzać dane, takie jak zachowanie podczas przeglądania lub unikalne identyfikatory na tej stronie. Brak wyrażenia zgody lub wycofanie zgody może niekorzystnie wpłynąć na niektóre cechy i funkcje.
Funkcjonalne Always active
Przechowywanie lub dostęp do danych technicznych jest ściśle konieczny do uzasadnionego celu umożliwienia korzystania z konkretnej usługi wyraźnie żądanej przez subskrybenta lub użytkownika, lub wyłącznie w celu przeprowadzenia transmisji komunikatu przez sieć łączności elektronicznej.
Preferencje
Przechowywanie lub dostęp techniczny jest niezbędny do uzasadnionego celu przechowywania preferencji, o które nie prosi subskrybent lub użytkownik.
Statystyka
Przechowywanie techniczne lub dostęp, który jest używany wyłącznie do celów statystycznych. Przechowywanie techniczne lub dostęp, który jest używany wyłącznie do anonimowych celów statystycznych. Bez wezwania do sądu, dobrowolnego podporządkowania się dostawcy usług internetowych lub dodatkowych zapisów od strony trzeciej, informacje przechowywane lub pobierane wyłącznie w tym celu zwykle nie mogą być wykorzystywane do identyfikacji użytkownika.
Marketing
Przechowywanie lub dostęp techniczny jest wymagany do tworzenia profili użytkowników w celu wysyłania reklam lub śledzenia użytkownika na stronie internetowej lub na kilku stronach internetowych w podobnych celach marketingowych.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
Zobacz preferencje
  • {title}
  • {title}
  • {title}