Tag: oop
new in Initializers (PHP 8.4)
PHP 8.4+
PHP 8.4 allows 'new ClassName()' expressions in default parameter values, attribute arguments, and static property initialisers — removing the need for null defaults combined with late assignment in constructors.
2mo ago
php intermediate
Named Constructor Pattern
PHP 5.0+
Static factory methods with descriptive names that replace overloaded constructors — making object creation intent clear when multiple creation paths exist.
3mo ago
php intermediate
Null Object Pattern
PHP 5.0+
Replace null with an object that implements the expected interface but performs no operation, eliminating null checks throughout the codebase.
3mo ago
quality intermediate