- var_export: documentation ( source)
<?php
$doc = new DOMDocument();
$doc->loadHTML('<html><body bar="">Test<br></body></html>');
var_export([
'foo' => $doc->getElementsByTagName('body')[0]->getAttribute('foo'),
'bar' => $doc->getElementsByTagName('body')[0]->getAttribute('bar'),
]);