You are here

public function Exporter::export in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/sebastian/exporter/src/Exporter.php \SebastianBergmann\Exporter\Exporter::export()

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 \n
  • Recursion and repeated rendering is treated properly

Parameters

mixed $value:

int $indentation The indentation level of the 2nd+ line:

Return value

string

1 call to Exporter::export()
Exporter::shortenedExport in vendor/sebastian/exporter/src/Exporter.php
Exports a value into a single-line string

File

vendor/sebastian/exporter/src/Exporter.php, line 45

Class

Exporter
A nifty utility for visualizing PHP variables.

Namespace

SebastianBergmann\Exporter

Code

public function export($value, $indentation = 0) {
  return $this
    ->recursiveExport($value, $indentation);
}