A nifty utility for visualizing PHP variables.
<?php use SebastianBergmann\Exporter\Exporter;
$exporter = new Exporter; print $exporter->export(new Exception);
◆ export()
SebastianBergmann\Exporter\Exporter::export |
( |
|
$value, |
|
|
|
$indentation = 0 |
|
) |
| |
Exports a value as a string
The output of this method is similar to the output of print_r(), but improved in various aspects:
- NULL is rendered as "null" (instead of "")
- TRUE is rendered as "true" (instead of "1")
- FALSE is rendered as "false" (instead of "")
- Strings are always quoted with single quotes
- Carriage returns and newlines are normalized to
- Recursion and repeated rendering is treated properly
- Parameters
-
int | $indentation | The indentation level of the 2nd+ line |
- Returns
- string
◆ recursiveExport()
SebastianBergmann\Exporter\Exporter::recursiveExport |
( |
& |
$value, |
|
|
|
$indentation, |
|
|
|
$processed = null |
|
) |
| |
|
protected |
Recursive implementation of export
- Parameters
-
mixed | $value | The value to export |
int | $indentation | The indentation level of the 2nd+ line |
\SebastianBergmann\RecursionContext\Context | $processed | Previously processed objects |
- Returns
- string
- See also
- SebastianBergmann\Exporter\Exporter::export
◆ shortenedExport()
SebastianBergmann\Exporter\Exporter::shortenedExport |
( |
|
$value | ) |
|
Exports a value into a single-line string
The output of this method is similar to the output of SebastianBergmann\Exporter\Exporter::export().
Newlines are replaced by the visible string '
'. Contents of arrays and objects (if any) are replaced by '...'.
- Returns
- string
- See also
- SebastianBergmann\Exporter\Exporter::export
◆ shortenedRecursiveExport()
SebastianBergmann\Exporter\Exporter::shortenedRecursiveExport |
( |
& |
$data, |
|
|
Context |
$context = null |
|
) |
| |
- Parameters
-
| array<mixed> | $data |
Context | $context | |
- Returns
- string
◆ toArray()
SebastianBergmann\Exporter\Exporter::toArray |
( |
|
$value | ) |
|
Converts an object to an array containing all of its private, protected and public properties.
- Returns
- array
The documentation for this class was generated from the following file: