Somewhere in your codebase sits a class written for one purpose: to delay a database connection until someone needs it. It was careful work once, tested, documented, and mildly admired in code review. PHP 8.4 now does that job inside the engine, in a few lines of reflection.
Here is the shift running under PHP 8.4 design patterns. Some patterns lost their reason to exist. Others gained a sharper one. And the runtime you deploy on, PHP-FPM or a long-running worker, decides which patterns are safe to keep.
This article sorts them: what to retire and what to keep at your system's edges, plus four short checks you can run on your codebase this week, with the trade-offs each choice carries.
Native lazy objects are the most significant change. Doctrine ORM 3.4 can use them instead of generating classes, and Symfony's lazy services build on them, which makes final and readonly classes eligible for lazy loading. A hand-written Proxy whose only job is deferral may no longer be necessary when your framework supports PHP 8.4's native lazy objects. Keep the pattern where it adds behavior, such as caching, access checks, or metering. For a web application where each request touches only a fraction of the services the container builds, native lazy objects can simplify deferred initialization and reduce the need for generated proxy classes, though the performance gains depend on the workload.
The gift has two costs. When a lazy object stands in for a separately built instance, the two have different identities, so code that compares with === or keys a map by spl_object_id behave differently. A ghost object initializes itself in place, preserving its object identity, which makes it a strong choice when your code constructs and retains the lazy instance directly. The second cost is quieter. Lazy initialization can defer failures until the object is first accessed. If initialization throws after producing external side effects, those effects are not automatically rolled back. A database connection failure that once surfaced during application startup may now appear on the first access that triggers the connection.
Property hooks cut the getter-and-setter ceremony and let validation sit beside the property. They come with limits. Readonly properties cannot declare property hooks, and indirect modifications to array elements held by a backed property can bypass its set hook. Default property values also bypass the set hook, and ordinary unserialize() can restore backing values without invoking it. Property hooks alone therefore do not guarantee that every value entering an object satisfies its invariants. Use hooks to validate at the edges, in DTOs and value objects, and to state property contracts in interfaces. Leave a stable getX() alone. A class that mixes both styles hands every newcomer two ways to read the same thing. Where invariants matter, validate values at construction and deserialization boundaries as well, and use explicit methods when they provide a clearer contract than property assignment.
Adapter earns its keep at one kind of seam: a vendor you don't control. A payment gateway, a storage SDK, and an analytics client. The test is blunt. If the vendor changed tomorrow, how many classes would you touch? A well-designed adapter aims to confine vendor-specific changes to one integration boundary. If the answer is eight, the class is a wrapper: it forwards calls while the vendor's vocabulary, its exceptions and response arrays, seeps into your domain.
A good adapter works like a customs desk: foreign terms get stamped into your language at the border, and nothing foreign wanders inside. Own the interface and shape it from your domain's side, with hooks stating what callers can read.
Skip the adapter where the framework has done the work. Laravel's filesystem layer already abstracts Flysystem and its adapters, so another layer often adds clutter unless it introduces a meaningful domain-specific interface, policy, or error-handling boundary. That build-or-lean decision repeats at every scale; it's the same one teams face when weighing custom development against open-source solutions.
Laravel's queued jobs and Symfony Messenger already provide much of the dispatching and messaging infrastructure many applications need, so a separate command bus is worthwhile only when it adds a clear application-level boundary. What's left to decide is whether the action needs to travel: queued, retried, audited, picked up by another worker. If so, a command object carries it. If not, a command class is a method with extra paperwork, and CRUD-heavy code feels that first. Holding the bus back until the pain repeats is the lean habit of deferring commitment, applied to architecture.
The Mediator needs sharper handling. A PSR-14 dispatcher is a mediator built to know nothing: listeners run synchronously, in the order the provider returns them, and when one throws, the rest never run. So the god-object risk shifts to the listeners. When listener B must run after listener A for the business process to remain correct, you have an ordering dependency that is often better expressed as an explicit workflow than as an implicit listener-registration order.
Events suit facts that independent parties react to. A sequence deserves a name and a place in the code, not a registration order.
Under a conventional PHP-FPM setup, the application is generally initialized for each request, so ordinary in-memory singleton state does not persist across requests, unlike in long-running application workers. Octane boots the application once and keeps it in memory, and a worker becomes a shop that never closes: whatever the last customer left on the counter is waiting for the next one. In Laravel Octane, service providers are normally registered and booted when the application starts in a worker, rather than being re-run for every request handled by that worker. A request injected into a singleton serves the first visitor's headers and input to everyone after. A static array that grows on each request is a memory leak, and the default restart after 500 requests only limits the damage.
Put the same test on every pattern that holds state: a Singleton, a registry, a memoizing Decorator, a listener list. Where does its state live, and when does it die? Avoid capturing request-specific data in long-lived services. Resolve the current request at the appropriate lifecycle boundary, or inject a narrowly scoped resolver that does not retain stale request or container state. Then test performance before launch while monitoring memory usage across repeated requests, as leaks and retained request state in long-running workers may only become visible under sustained load.
Four checks fit in a sprint. If the answers turn up more than the roadmap can absorb, technology consultation can scope the work, and dedicated PHP developers can carry the refactor while your team keeps shipping.
Every pattern here came down to one decision: where change is allowed to enter. An Adapter guards the vendor's edge, a command bus guards work that has to travel, and the runtime guards which state may outlive a request. PHP 8.4 took the plumbing. The judgment stayed with you.
Codebases keep patterns out of habit, and habit makes onboarding expensive. Tie each survivor to a boundary you can name, and a new engineer can read why it exists. PHP 8.4's active support is scheduled to end on 31 December 2026, with security support continuing through 31 December 2028. That gives teams a defined maintenance window, but architecture and upgrade decisions should still account for the support status of their frameworks and dependencies.
Write down the boundary each remaining pattern protects. Where that list stalls, a second opinion settles it faster than another meeting, and Techosquare's PHP development services team is ready for that conversation.