You are here

public static function ExportUtil::export in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpspec/prophecy/src/Prophecy/Util/ExportUtil.php \Prophecy\Util\ExportUtil::export()

Exports a value into 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 The value to export:

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

Return value

string

2 calls to ExportUtil::export()
ExportUtil::recursiveExport in vendor/phpspec/prophecy/src/Prophecy/Util/ExportUtil.php
Recursive implementation of export.
StringUtil::stringify in vendor/phpspec/prophecy/src/Prophecy/Util/StringUtil.php
Stringifies any provided value.

File

vendor/phpspec/prophecy/src/Prophecy/Util/ExportUtil.php, line 46

Class

ExportUtil
Exporting utility.

Namespace

Prophecy\Util

Code

public static function export($value, $indentation = 0) {
  return static::recursiveExport($value, $indentation);
}