PHP Traits: What They Are and When to Use Them
A practical look at PHP traits: why they exist and how to share behavior across unrelated classes without the pitfalls of multiple inheritance.
Tag
Building applications with PHP: language features, versions and practices. (Page 4/8)
There are 48 posts with this tag.
A practical look at PHP traits: why they exist and how to share behavior across unrelated classes without the pitfalls of multiple inheritance.
A look at readonly classes, DNF types, and standalone type declarations in PHP 8.2, and their impact on domain modeling.
Embedding meaning into code instead of relying on primitives: why and how to design value objects in PHP.
Personal notes on why mastering multiple programming languages is a matter of tool selection, not identity.
PHP 8.1 isn't out yet, but I'm already exploring how the upcoming native enum support and readonly properties will reshape domain modelling.
A practical look at PHP type conversion and coercion: gettype, settype, var_dump, and why strict_types belongs in every file.