This component provides the functionality to export PHP variables for visualization.
Installation
You can add this library as a local, per-project dependency to your project using Composer:
composer require sebastian/exporter
If you only need this library during development, for instance to run your project’s test suite, then you should add it as a development-time dependency:
<?php
use SebastianBergmann\Exporter\Exporter;
$exporter = new Exporter;
// Array ()
print $exporter->shortenedExport(array());
// Array (...)
print $exporter->shortenedExport(array(1,2,3,4,5));
// stdClass Object ()
print $exporter->shortenedExport(new stdClass);
// Exception Object (...)
print $exporter->shortenedExport(new Exception);
// this\nis\na\nsuper\nlong\nstring\nt...\nspace
print $exporter->shortenedExport(
<<<LONG_STRING
this
is
a
super
long
string
that
wraps
a
lot
and
eats
up
a
lot
of
space
LONG_STRING
);
sebastian/exporter
This component provides the functionality to export PHP variables for visualization.
Installation
You can add this library as a local, per-project dependency to your project using Composer:
If you only need this library during development, for instance to run your project’s test suite, then you should add it as a development-time dependency:
Usage
Exporting:
Data Types
Exporting simple types:
Exporting complex types:
Compact exports: