Skip to content

feat(opcache): relocate closures/arrow functions (dynamic_func_defs) in cache binaries #115

Closed

Description

@lisachenko

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

PayloadRelocator refuses op_arrays that define closures/arrow functions: it throws OpCacheException::unsupportedPayload('dynamic function definitions (closures/arrow fns) relocation') when op_array->num_dynamic_func_defs > 0 (src/OpCache/PayloadRelocator.php:588, :644).

Scope: port the dynamic_func_defs branch of zend_file_cache_(un)serialize_op_array — relocate the dynamic_func_defs array and recurse into each nested op_array, both directions.

Acceptance: a fixture whose functions contain a fn() / function() closure round-trips byte-for-byte and executes from the patched cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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