Tag: oop
Property Hooks (PHP 8.4)
PHP 8.4+
PHP 8.4 property hooks add get and set accessors directly to property declarations — eliminating the need for explicit getter/setter methods on simple value objects.
2mo ago
php advanced
PHP 5 OOP Revolution — Objects by Reference
PHP 5.0+
PHP 5 completely replaced PHP 4's object model — objects became reference-counted handles rather than copies, enabling true OOP with interfaces, abstract classes, visibility, and exceptions.
2mo ago
php intermediate
Property Hooks (PHP 8.4)
PHP 8.0+
PHP 8.4 property hooks attach get and set logic directly to a property declaration — co-locating validation and transformation with the property itself.
3mo ago
php advanced
Prototype Pattern
PHP 5.0+
Creating new objects by cloning a prototype — fast when object creation is expensive and variations are needed.
3mo ago
quality intermediate
Parallel Inheritance Hierarchies
Every time you create a subclass of one class, you must also create a corresponding subclass of another — a sign of entangled designs.
3mo ago
quality intermediate
PHP Namespaces
PHP 5.3+
Logical groupings that prevent class name collisions and form the basis of PSR-4 autoloading.
3mo ago
php beginner
Primitive Obsession
PHP 5.0+
1
Using raw strings, ints, and arrays to represent domain concepts instead of small dedicated value objects.
3mo ago
quality intermediate
Property Hooks (PHP 8.4)
PHP 8.4+
PHP 8.4 allows get and set hooks directly on class properties — replacing boilerplate getter/setter methods with inline logic on the property declaration.
3mo ago
php intermediate
Prototypal Inheritance
ES5
JavaScript objects inherit from other objects via a prototype chain — class syntax is syntactic sugar over this mechanism.
3mo ago
javascript intermediate
Proxy Pattern
PHP 5.0+
Provides a surrogate object that controls access to another object, adding indirection for lazy loading, caching, logging, or access control.
3mo ago
quality intermediate
Python Dataclasses & Pydantic
Python 3.7+
1
@dataclass auto-generates __init__, __repr__, __eq__; Pydantic adds runtime validation and serialisation — Python's equivalent of typed DTOs.
3mo ago
python intermediate
Property Hooks (PHP 8.4)
PHP 8.4+
PHP 8.4 property hooks attach get/set logic directly to a property declaration — eliminating getter/setter method boilerplate for common validation and transformation patterns.
php advanced