Download the PHP package bermudaphp/var-export without Composer
On this page you can find all versions of the php package bermudaphp/var-export. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package var-export
VarExporter
Русская версия
PHP library for exporting variables to their string representation with advanced formatting options and closure support.
Features
- Multiple data types support: arrays, closures, scalar values, and more
- Two formatting modes: standard (compact) and pretty (indented)
- Closure export: Full closure source code extraction with namespace resolution
- Configurable formatting: Custom indentation, key sorting, trailing commas
- Special value handling: INF, NAN, magic constants
- PHP-Parser integration: Advanced AST analysis for closures
- Exception handling: Detailed error information for debugging
Installation
Quick Start
Usage Examples
Basic Variable Export
Array Export
Closure Export
Configuration Options
Using Convenience Functions
Advanced Configuration
Custom Formatting
Custom Exporters
Configuration Options
Option | Type | Default | Description |
---|---|---|---|
mode |
FormatterMode |
STANDARD |
Formatting mode (STANDARD or PRETTY) |
indent |
string |
' ' |
Indentation string (4 spaces by default) |
maxDepth |
int |
100 |
Maximum nesting depth to prevent infinite recursion |
sortKeys |
bool |
false |
Whether to sort array keys |
trailingComma |
bool |
false |
Whether to add trailing commas in arrays |
Supported Types
✅ Supported
- Arrays: Indexed and associative arrays with full nesting support
- Closures: Anonymous functions and arrow functions with source code extraction
- Scalars: integers, floats, strings, booleans, null
- Special values: INF, -INF, NAN
❌ Not Supported
- Objects: Regular objects (except closures)
- Resources: File handles, database connections, etc.
Error Handling
The library provides detailed exception information:
Requirements
- PHP 8.1 or higher
- nikic/php-parser (for closure export functionality)
All versions of var-export with dependencies
PHP Build Version
Package Version
The package bermudaphp/var-export contains the following files
Loading the files please wait ....