Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Varexporter Laravel Package

brick/varexporter

Prettier, safer alternative to PHP var_export(). Exports variables as standalone executable PHP code (no runtime dependency) with short array syntax, cleaner numeric arrays, and support for closures and custom objects beyond __set_state(), ideal for fast OPcache-friendly caching.

View on GitHub
Deep Wiki
Context7
0.7.0

✨ 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
0.6.0

πŸ’₯ BC breaks

  • Minimum PHP version is now 8.1 (#39)

✨ New features

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

Thanks to @reinfi!

0.5.0

✨ 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
0.4.0

Minimum PHP version is now 7.4. No breaking changes.

0.3.8

✨ New feature

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

Thanks @AnnaDamm!

0.3.7

✨ New feature

  • New option: VarExporter::INLINE_ARRAY

πŸ—‘οΈ Deprecated

  • The VarExporter::INLINE_NUMERIC_SCALAR_ARRAY is deprecated, please use INLINE_SCALAR_LIST instead
0.3.6

✨ New feature

Support for PHP 8.1 enums (#23).

Thanks @Jacobs63!

0.3.5

✨ New feature

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

Thanks @ADmad!

0.3.4

✨ New feature

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

Thanks @ADmad!

0.3.3

πŸ› Bug fix

  • Exporting an object with numeric dynamic properties would lead to a TypeError
0.3.2

✨ New feature

Support for exporting internal classes implementing __set_state():

  • DateTime
  • DateTimeImmutable
  • DateTimeZone
  • DateInterval
  • DatePeriod

Thanks @GameplayJDK!

0.3.1

✨ 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!

0.3.0

Minimum PHP version is now 7.2. No breaking changes.

0.2.1

✨ New option: VarExporter::INLINE_NUMERIC_SCALAR_ARRAY (#3)

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

0.2.0

✨ 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.
0.1.2

πŸ› 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.
0.1.1

πŸ› 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.

0.1.0

First release.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport