Skip to content

Pointcut ids depend on registration order (PointcutBuilder::$index static counter) #640

Description

@lisachenko

Problem

src/Aop/Support/PointcutBuilder.php:31 keeps a private static int $index auto-increment used to build pointcut ids. Those ids become container keys and end up in the advisor cache, so id stability depends on aspect registration order across the whole process — two hosts registering aspects in different order produce incompatible caches, and a shared/prebuilt cache can silently mismatch.

Proposed change (for discussion)

  • Instance-scope the counter, or better: derive the id deterministically by hashing the pointcut expression + declaring aspect (stable across processes and registration order).
  • Consider a cache-format version bump if id shape changes (interacts with the advisor-cache RFC).

Effort S, risk low. Registered for tracking; interplay with the opcache-friendly advisor cache RFC should be settled first.

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