# symfony/var-exporter

Provides tools to export, instantiate, hydrate, clone and lazy-load PHP objects

Repository: https://github.com/symfony/var-exporter
Canonical: https://ross.abutalabs.com/products/var-exporter
Homepage: https://symfony.com/var-exporter
Language: PHP
License: MIT
License Family: permissive
Topics: php, symfony, component, symfony-component, clone, construct, export, hydrate, instantiate, lazy-loading, proxy, serialize, deep-clone
Last push: 2026-08-23T10:16:04+00:00

## Health v2 (maintenance only)
Score: 99/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 99, longevity 100
- inputs: {"age_days": 2926, "days_push": 10, "days_rel": 11, "gap_med": 0.0, "n_releases_24m": 39}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2098, forks 7 (observed 2026-08-28T04:06:13.406766+00:00)

## What it is
A Symfony PHP component that exports any serializable PHP data structure to plain PHP code, and provides deep cloning, constructor-less instantiation/hydration, and lazy-loading proxies for PHP objects. It leverages OPcache for faster, more memory-efficient serialization than serialize() or igbinary.

## Use cases
- export PHP variables to plain PHP code for caching
- serialize PHP objects faster than serialize() or igbinary
- deep-clone PHP object graphs efficiently
- instantiate objects without calling their constructors
- hydrate private, protected and readonly properties
- generate lazy-loading proxies for classes and interfaces
- store cache files that regenerate variables via require

## When to choose
- you need OPcache-accelerated serialization of PHP values in cache files
- you must clone or hydrate objects while preserving serialization semantics
- you need lazy-loading decorators or native lazy objects
- you work within Symfony or a framework using Symfony components

## When to avoid
- you need language-agnostic serialization formats like JSON
- you serialize data for non-PHP consumers
- you only need simple var_export-style debugging output

## Facets
- artifact type: library
- maturity: stable
- function: serialization, developer-tools
- domain: developer-tools, programming-languages, performance
- platform: php, cross-platform
- tags: php, symfony-component, var-export, deep-clone, lazy-loading, proxy, opcache, hydrate, instantiation

## Member repositories
- symfony/var-exporter (main) score 99

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:13.406766+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:54:32.126504+00:00, confidence not recorded.
  - readme: https://github.com/symfony/var-exporter (fetched 2026-08-28T04:06:13.406766+00:00, sha c59b0a69c822)
  - homepage: https://symfony.com/var-exporter (fetched 2026-08-29T10:34:49.032488+00:00, sha c36cb3b4901e)
  - site_page: https://symfony.com/doc (fetched 2026-08-29T10:34:49.034756+00:00, sha 44889134f4fb)
  - site_page: https://symfony.com/doc/current/components/var_exporter.html (fetched 2026-08-29T10:34:49.036894+00:00, sha cfd1bc39d638)
  - site_page: https://symfony.com/releases (fetched 2026-08-29T10:34:49.039690+00:00, sha 5bd749e2b676)
  - site_page: https://symfony.com/blog/category/releases (fetched 2026-08-29T10:34:49.041899+00:00, sha d8584ccbba1c)
- Data as of 2026-08-30T08:39:29.467469+00:00.
