Skip to content

feat(opcache): relocate iterator-aware and ArrayAccess classes in cache binaries #116

Closed

Description

@lisachenko

Follow-up to the OpCache binary-file API (#111, merged).

PayloadRelocator refuses classes carrying cached iterator/ArrayAccess dispatch tables: it throws unsupportedPayload('iterator-aware class relocation') / ('ArrayAccess class relocation') when ce->iterator_funcs_ptr / ce->arrayaccess_funcs_ptr are set (src/OpCache/PayloadRelocator.php:979-992).

Scope: port the iterator_funcs_ptr and arrayaccess_funcs_ptr branches of zend_file_cache_(un)serialize_class — relocate the struct pointer and each zf_* function pointer, both directions. Note the serializer also swaps get_iterator to/from HOOKED_ITERATOR_PLACEHOLDER; mirror that if we ever execute in-process (we currently don't).

Acceptance: fixtures implementing Iterator/IteratorAggregate and ArrayAccess round-trip byte-for-byte and execute from the patched cache.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestopcacheIssue is related to opcache integration. Either doesn't work well or behaves incorrect.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions