Export variables to a readable format

Code
<?php

use SebastianBergmann\Exporter\Exporter;

$exporter = new Exporter();

// a print_r like output
echo $exporter->export("string\nnewline") . PHP_EOL;
echo 
$exporter->export(1) . PHP_EOL;
echo 
$exporter->export(null) . PHP_EOL;
echo 
$exporter->export(true) . PHP_EOL;
echo 
$exporter->export(
    [
'key' => 'value'42=> null]
);
Result
'string
newline'
1
null
true
Array &0 (
'key' => 'value'
0 => 42
7 => null
)
Used Versions
PHP 7.1, Zend 3.0, Symfony 3.2, Laravel 5.2, PHPUnit 5.6, Doctrine 2.6