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
@since Method available since Release 3.6.0
Parameters
mixed $value The value to export:
integer $indentation The indentation level of the 2nd+ line:
Return value
string
File
- drupal/core/vendor/phpunit/phpunit/PHPUnit/Util/Type.php, line 98
Class
- PHPUnit_Util_Type
- Utility class for textual type (and value) representation.
Code
public static function export($value, $indentation = 0) {
return self::recursiveExport($value, $indentation);
}