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\n
newline'
1
null
true
Array &0 (
'key' => 'value'
0 => 42
7 => null
)
Used Versions
PHP 8.2, Laminas MVC 3.2, Symfony 5.2, Laravel 8.28, PHPUnit 9.5, Doctrine ORM 2.8