# opis/closure

Serialize closures, anonymous classes, and arbitrary data

Repository: https://github.com/opis/closure
Canonical: https://ross.abutalabs.com/products/closure
Homepage: https://opis.io/closure
Language: PHP
License: MIT
License Family: permissive
Topics: php, closure-serialization, serializable-closures, data-serialization, anonymous-class-serialization, serialization
Last push: 2026-03-05T13:34:35+00:00

## Health v2 (maintenance only)
Score: 77/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 70, release rhythm 73, longevity 100
- inputs: {"age_days": 4587, "days_push": 181, "days_rel": 181, "gap_med": 2, "n_releases_24m": 10}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2571, forks 94 (observed 2026-08-28T04:07:01.461522+00:00)

## What it is
Opis Closure is a PHP library that serializes closures, anonymous classes, and arbitrary data, overcoming PHP's native serialization limitations. It supports PHP 8.x syntax, circular references, custom serializers, and cryptographically signed data.

## Use cases
- serialize closures in php
- serialize anonymous classes
- queue closures for later execution
- cache serializable closures
- sign serialized data cryptographically
- serialize arbitrary php objects with circular references

## When to choose
- you need to serialize closures or anonymous classes in PHP 8+
- you need serialization without PHP extensions like FFI
- you need cryptographically signed serialized data
- you need debugger-friendly reconstructed closure code

## When to avoid
- your project runs on PHP 7.x (use version 3.x instead)
- you only serialize plain data PHP handles natively
- you need cross-language serialization formats like JSON or protobuf

## Facets
- artifact type: library
- maturity: stable
- function: serialization
- domain: developer-tools, programming-languages
- platform: php
- tags: closures, anonymous-classes, php-library, data-signing

## Member repositories
- opis/closure (main) score 77

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:01.461522+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:23:17.606013+00:00, confidence not recorded.
  - readme: https://github.com/opis/closure (fetched 2026-08-28T04:07:01.461522+00:00, sha 0fc26b0e8203)
  - homepage: https://opis.io/closure (fetched 2026-08-29T10:05:35.365990+00:00, sha 125636121a87)
  - site_page: https://opis.io/closure/4.x (fetched 2026-08-29T10:05:35.375126+00:00, sha 3b5e31940d81)
- Data as of 2026-08-30T08:39:29.467469+00:00.
