Skip to content
PHP Ecosystem
Explore

PrintRParser

API reference › Debug Core › Panel › Log › PrintRParser

final classPHPForge\Debug\Panel\Log\PrintRParser
Sourcesrc/Panel/Log/PrintRParser.php

Parses the output of print_r($value, true) for an array, object, or enum into a DumpNode tree.

Only the root header may carry free text before it, such as Request: Array. Any other deviation from the print_r() layout, or an exceeded bound, yields null; the parser never throws.

MethodDescriptionDefined by
parse() staticParses a print_r() dump of an array, object, or enum.PrintRParser
ConstantValueDescriptionDefined by
MAX_BYTES262144Maximum size of a parsed message, in bytes, shared with PhpExportTokenizer.PrintRParser
MAX_DEPTH32Maximum nesting level of blocks, the root block included, shared with the export classes and DumpNode.PrintRParser
MAX_NODES5000Maximum number of values, the root block included, shared with PhpExportParser and DumpNode.PrintRParser
public static function parse(string $message): PHPForge\Debug\Panel\Log\DumpNode|null

Parses a print_r() dump of an array, object, or enum.

Parameters

ParameterTypeDescription
$messagestring

Returns

DumpNode|null: Root block, with the free text preceding its header as DumpNode::$text, or null for an unsupported message.