Skip to content

Evaluate lazy-ghost initialization for ReflectionConstructorInvocation::proceed() #618

Description

@lisachenko

Summary

Follow-up to #606 (closed by #612, which implemented native lazy objects in Container and CachedAspectLoader). Item 3 of that issue — rewriting ReflectionConstructorInvocation::proceed() (src/Aop/Framework/ReflectionConstructorInvocation.php ~65-77, currently newInstanceWithoutConstructor() + manual getConstructor()?->invoke(...)) via the PHP 8.4 lazy-ghost initializer sequence — was deliberately skipped and needs its own ticket so it isn't lost.

Why it was skipped in #612

  • A lazy ghost there would either need immediate forced initialization (no gain over the explicit sequence) or would defer constructor side effects, changing observable behavior around getThis() and Before advices.
  • newLazyGhost() rejects classes the current sequence handles fine (internal classes, property-less classes).

What this ticket asks

Design a behavior-preserving adoption (or conclude and document that the explicit sequence is the right mechanism). If adopted, it is also the natural groundwork for the gap noted in docs/php84-limitations.md: no join point exists today for the moment a lazy proxy materializes.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions