PHP & Software Engineering Blog
Articles about PHP, software architecture, system design and AI engineering - written from production work, not from the sidelines.
-
PHP 8: Making the Choice Between "switch" and "match"
PHP 8 brought an innovative feature - the match expression. It is an effective counterpart to switch. Let's explore their distinctions.
-
Towards Powerful PHP Applications: WeakMaps and Their Practical Usage
Read more about PHP WeakMap data structure added with version 8. WeakMaps are helpful for memory management and avoid leaks.
-
Understanding PHP's Shift: Migrating from Resources to Objects
Discover PHP's evolution, shifting focus from resources to objects, offering enhanced programming capabilities.
-
Metadata Attributes and Their Impact on Modern Development with PHP
PHP Attributes were added with version 8. In this post, I give an overview and my opinion on where and how to use them.
-
How and When to Use PHP's Pure Intersection Types
Pure Intersection Types in PHP8.1 are a language feature to have more control over return and parameter types.
-
PHP Fibers: What They Are and Where To Use
Fibers are introduced to PHP and are a elegant way to simulate parallel work. Read more about how they differ from threads and coroutines.
-
PHP Enums: Complete Guide to Best Practices (PHP 8.1+)
Complete guide to PHP enums: pure vs backed enums, comparison, pre-8.1 patterns, when not to use enums, and best practices from production codebases.
-
PHP Readonly Properties and Classes: Immutability Complete Guide
Complete guide to PHP readonly properties (8.1) and readonly classes (8.2): immutability benefits, getters vs readonly, syntax differences, constraints, and when to use each.
-
About Mocking in Unit Tests
Mocking in unit tests is a powerful technique. This post addresses when and how to use mocks properly in PHP.
-
PHP Traits: When to Use Them (and Why to Avoid Them)
Complete guide to PHP traits: what they are, what changed in PHP 8.0–8.3, why they violate SOLID principles, and why Dependency Injection is the better alternative.