Documentation

DOMDocumentPlugin extends Plugin
in package

The DOMDocument parser plugin is particularly useful as it is both the only way to see inside the DOMNode without print_r, and the only way to see mixed text and node inside XML (SimpleXMLElement will strip out the text).

Table of Contents

$blacklist  : array<string|int, mixed>
List of properties to skip parsing.
$verbose  : bool
Show all properties and methods.
$parser  : mixed
getTriggers()  : mixed
getTypes()  : array<string|int, mixed>
An array of types (As returned by gettype) for all data this plugin can operate on.
parse()  : mixed
setParser()  : mixed
parseList()  : mixed
parseNode()  : mixed
parseProperty()  : mixed
textualNodeToString()  : mixed

Properties

$blacklist

List of properties to skip parsing.

public static array<string|int, mixed> $blacklist = array('parentNode' => 'DOMNode', 'firstChild' => 'DOMNode', 'lastChild' => 'DOMNode', 'previousSibling' => 'DOMNode', 'nextSibling' => 'DOMNode', 'ownerDocument' => 'DOMDocument')

The properties of a DOMNode can do a lot of damage to debuggers. The DOMNode contains not one, not two, not three, not four, not 5, not 6, not 7 but 8 different ways to recurse into itself:

  • firstChild
  • lastChild
  • previousSibling
  • nextSibling
  • ownerDocument
  • parentNode
  • childNodes
  • attributes

All of this combined: the tiny SVGs used as the caret in Kint are already enough to make parsing and rendering take over a second, and send memory usage over 128 megs. So we blacklist every field we don't strictly need and hope that that's good enough.

In retrospect - this is probably why print_r does the same

$verbose

Show all properties and methods.

public static bool $verbose = false

Methods

getTypes()

An array of types (As returned by gettype) for all data this plugin can operate on.

public getTypes() : array<string|int, mixed>
Return values
array<string|int, mixed>

List of types

setParser()

public setParser(Parser $p) : mixed
Parameters
$p : Parser
Return values
mixed

Search results