PackageTrack
Sign in Get early access

brick/varexporter

A powerful alternative to var_export(), which can export closures and objects without __set_state()

0.7.0 35M downloads/mo #602 most downloaded on Packagist brick/varexporter

What this package is like to depend on

Last release 7 months ago

06 Jan 2026

Release timing varies

gaps range from 2 weeks to 1.4 years

Nearly every release is documented

notes for 18 of 18 stable releases

Nothing withdrawn

no release was ever pulled

7 years old

18 releases · first in 2019

1 release in the last 12 months

see the full history below

Release timeline

18 releases · Apr 2019 to Jan 2026
2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 18
  1. 0.7.0 06 Jan 2026
    Release notes

    New features

    • Added VarExporter::INLINE_LITERAL_LIST, similar to INLINE_SCALAR_LIST but includes enum values

    💥 BC breaks

    • Minimum PHP version is now 8.2
    Open source →
    Release notes

    New features

    • Added VarExporter::INLINE_LITERAL_LIST, similar to INLINE_SCALAR_LIST but includes enum values

    💥 BC breaks

    • Minimum PHP version is now 8.2
    Open source →
    Release notes

    0.7.0 Latest

    Latest

    Compare

    Choose a tag to compare

    Open source →
  2. 0.6.0 20 Feb 2025
    Release notes

    💥 BC breaks

    • Minimum PHP version is now 8.1 (#39)

    New features

    • Support for exporting match constructs in closures (#38)

    Thanks to @reinfi!

    Open source →
    Release notes

    💥 BC breaks

    • Minimum PHP version is now 8.1 (#39)

    New features

    • Support for exporting match constructs in closures (#38)

    Thanks to @reinfi!

    Open source →
    Release notes

    0.6.0

    Compare

    Choose a tag to compare

    Open source →
  3. 0.5.0 10 May 2024
    Release notes

    Compatibility

    • Added compatibility with nikic/php-parser 5.x
    • Removed compatibility with nikic/php-parser 4.x

    💥 BC breaks

    • deprecated constant VarExporter::INLINE_NUMERIC_SCALAR_ARRAY has been removed, please use INLINE_SCALAR_LIST instead
    Open source →
    Release notes

    Compatibility

    • Added compatibility with nikic/php-parser 5.x
    • Removed compatibility with nikic/php-parser 4.x

    💥 BC breaks

    • deprecated constant VarExporter::INLINE_NUMERIC_SCALAR_ARRAY has been removed, please use INLINE_SCALAR_LIST instead
    Open source →
    Release notes

    0.5.0

    Compare

    Choose a tag to compare

    Open source →
  4. 0.4.0 01 Sep 2023
    Release notes

    Minimum PHP version is now 7.4. No breaking changes.

    Open source →
    Release notes

    Minimum PHP version is now 7.4. No breaking changes.

    Open source →
    Release notes

    0.4.0

    Compare

    Choose a tag to compare

    Open source →
  5. 0.3.8 21 Jan 2023
    Release notes

    New feature

    • Support for PHP 8.1 readonly properties (#27, #28)

    Thanks @AnnaDamm!

    Open source →
    Release notes

    New feature

    • Support for PHP 8.1 readonly properties (#27, #28)

    Thanks @AnnaDamm!

    Open source →
    Release notes

    0.3.8

    Compare

    Choose a tag to compare

    Open source →
  6. 0.3.7 29 Jun 2022
    Release notes

    New feature

    • New option: VarExporter::INLINE_ARRAY

    🗑️ Deprecated

    • The VarExporter::INLINE_NUMERIC_SCALAR_ARRAY is deprecated, please use INLINE_SCALAR_LIST instead
    Open source →
    Release notes

    New feature

    • New option: VarExporter::INLINE_ARRAY

    🗑️ Deprecated

    • The VarExporter::INLINE_NUMERIC_SCALAR_ARRAY is deprecated, please use INLINE_SCALAR_LIST instead
    Open source →
    Release notes

    0.3.7

    Compare

    Choose a tag to compare

    Open source →
  7. 0.3.6 15 Jun 2022
    Release notes

    New feature

    Support for PHP 8.1 enums (#23).

    Thanks @Jacobs63!

    Open source →
    Release notes

    New feature

    Support for PHP 8.1 enums (#23).

    Thanks @Jacobs63!

    Open source →
    Release notes

    0.3.6

    Compare

    Choose a tag to compare

    Open source →
  8. 0.3.5 10 Feb 2021
    Release notes

    New feature

    Support for controlling the base indentation level (#17).

    Thanks @ADmad!

    Open source →
    Release notes

    New feature

    Support for controlling the base indentation level (#17).

    Thanks @ADmad!

    Open source →
    Release notes

    0.3.5

    Compare

    Choose a tag to compare

    Open source →
  9. 0.3.4 07 Feb 2021
    Release notes

    New feature

    Support for trailing comma in non-inline arrays, with the TRAILING_COMMA_IN_ARRAY flag (#16).

    Thanks @ADmad!

    Open source →
    Release notes

    New feature

    Support for trailing comma in non-inline arrays, with the TRAILING_COMMA_IN_ARRAY flag (#16).

    Thanks @ADmad!

    Open source →
    Release notes

    0.3.4

    Compare

    Choose a tag to compare

    Open source →
  10. 0.3.3 24 Dec 2020
    Release notes

    🐛 Bug fix

    • Exporting an object with numeric dynamic properties would lead to a TypeError
    Open source →
    Release notes

    🐛 Bug fix

    • Exporting an object with numeric dynamic properties would lead to a TypeError
    Open source →
    Release notes

    0.3.3

    Compare

    Choose a tag to compare

    Open source →
  11. 0.3.2 13 Mar 2020
    Release notes

    New feature

    Support for exporting internal classes implementing __set_state():

    • DateTime
    • DateTimeImmutable
    • DateTimeZone
    • DateInterval
    • DatePeriod

    Thanks @GameplayJDK!

    Open source →
  12. 0.3.1 23 Jan 2020
    Release notes

    New features

    • Support for closures with use() using the CLOSURE_SNAPSHOT_USE option (#7)
    • Support for arrow functions in PHP 7.4 (#8)

    Thanks to @jasny for his awesome work!

    Open source →
  13. 0.3.0 24 Dec 2019
    Release notes

    Minimum PHP version is now 7.2. No breaking changes.

    Open source →
  14. 0.2.1 16 Apr 2019
    Release notes

    New option: VarExporter::INLINE_NUMERIC_SCALAR_ARRAY (#3)

    Formats numeric arrays containing only scalar values on a single line.

    Open source →
  15. 0.2.0 08 Apr 2019
    Release notes

    New feature

    • Experimental support for closures 🎉

    💥 Minor BC break

    • export() does not throw an exception anymore when encountering a Closure.
      To get the old behaviour back, use the NO_CLOSURES option.
    Open source →
  16. 0.1.2 08 Apr 2019
    Release notes

    🐛 Bug fixes

    • Static properties in custom classes were wrongly included—unset()—in the output

    Improvements

    • Circular references are now detected, and throw an ExportException instead of erroring.
    Open source →
  17. 0.1.1 08 Apr 2019
    Release notes

    🐛 Bug fixes

    • Single-letter properties were wrongly exported using ->{'x'} notation.

    Improvements

    • Exception messages now contain the path (array keys / object properties) to the failure:

      [foo][bar][0] Type "resource" is not supported.

    Open source →
  18. 0.1.0 07 Apr 2019
    Release notes

    First release.

    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive