PHP 8.6 Released: Property Hooks, Asymmetric Visibility and Lazy Objects
PHP 8.6 adds property hooks for custom get/set logic, asymmetric visibility for readonly properties, lazy objects for deferred initialisation, and new reflection methods, all without breaking changes.

By Ryan Chua, Cloud & Enterprise Tech
, updated 3 min read
PHP 8.6 was released on 19 November 2026, bringing a focused set of language features that improve developer ergonomics without introducing breaking changes. The release centres on four main additions: property hooks, asymmetric visibility, lazy objects, and new reflection methods.
Property hooks
Property hooks let you define custom getter and setter logic directly on a property declaration. This replaces the need for magic __get and __set methods or separate getter/setter methods for simple transformations.
class User {
public string $name {
get => strtoupper($this->name);
set => $this->name = trim($value);
}
}The hook syntax supports get, set, or both. Hooks can access $this and the implicit $value parameter in setters. They work with typed properties and respect the declared type.
Asymmetric visibility
Readonly properties can now have different visibility for reading and writing. A property can be publicly readable but privately writable, or protected for writes while public for reads.
class Config {
public private(set) string $environment = 'production';
}This is useful for configuration objects, DTOs, and any case where external code should read a value but only the owning class controls mutations.
Lazy objects
The new LazyObject interface and new lazy syntax create objects that defer initialisation until the first property access. This reduces memory and startup cost for heavy dependencies that may not be used in every request.
$service = new lazy HeavyService();
// HeavyService constructor runs only when $service->method() is calledThe feature is designed for dependency injection containers and service locators where not every registered service is needed on every code path.
New reflection methods
ReflectionProperty::isReadable() and ReflectionProperty::isWritable() answer whether a property can be read or written from a given scope, taking into account visibility, readonly, and hooks.
No breaking changes
The PHP team emphasises that 8.6 introduces no breaking changes. Existing code continues to run. Deprecations target dynamic properties and ${} string interpolation, both already discouraged.
Why it matters
PHP 8.6 continues the language's steady evolution toward cleaner object-oriented code. Property hooks and asymmetric visibility reduce boilerplate. Lazy objects give framework authors a standard way to defer expensive initialisation. For teams on PHP 8.2 or 8.3, the upgrade path is straightforward.
Sources
- 1PHP 8.6 Release Announcementphp.net