Use strings to work with ini_get() and ini_set()

Additionally, set the new value and get the old one in one ini_set() call.
parent e247a103
......@@ -17,7 +17,6 @@ use function explode;
use function extension_loaded;
use function get_class;
use function html_entity_decode;
use function ini_get;
use function ini_set;
use function is_array;
use function is_object;
......@@ -55,14 +54,11 @@ final class Dumper
*/
public static function dump($var, int $maxDepth = 2) : string
{
$html = ini_get('html_errors');
if ($html !== true) {
ini_set('html_errors', true);
}
$html = ini_set('html_errors', '1');
assert(is_string($html));
if (extension_loaded('xdebug')) {
ini_set('xdebug.var_display_max_depth', $maxDepth);
ini_set('xdebug.var_display_max_depth', (string) $maxDepth);
}
$var = self::export($var, $maxDepth);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment