Exporter
in package
FinalYes
Table of Contents
Methods
- export() : string
- Exports a value as a string.
- shortenedExport() : string
- Exports a value into a single-line string.
- shortenedRecursiveExport() : string
- toArray() : array<string|int, mixed>
- Converts an object to an array containing all of its private, protected and public properties.
- recursiveExport() : string
Methods
export()
Exports a value as a string.
public
export(mixed $value[, int $indentation = 0 ]) : 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 \n
- Recursion and repeated rendering is treated properly
Parameters
- $value : mixed
- $indentation : int = 0
Return values
stringshortenedExport()
Exports a value into a single-line string.
public
shortenedExport(mixed $value) : string
The output of this method is similar to the output of SebastianBergmann\Exporter\Exporter::export().
Newlines are replaced by the visible string '\n'. Contents of arrays and objects (if any) are replaced by '...'.
Parameters
- $value : mixed
Return values
stringshortenedRecursiveExport()
public
shortenedRecursiveExport(array<string|int, mixed> &$data[, Context|null $context = null ]) : string
Parameters
- $data : array<string|int, mixed>
- $context : Context|null = null
Return values
stringtoArray()
Converts an object to an array containing all of its private, protected and public properties.
public
toArray(mixed $value) : array<string|int, mixed>
Parameters
- $value : mixed
Return values
array<string|int, mixed>recursiveExport()
private
recursiveExport(mixed &$value, int $indentation[, Context|null $processed = null ]) : string
Parameters
- $value : mixed
- $indentation : int
- $processed : Context|null = null