src/Debug/Output/HtmlObject.php
protected function dumpToString($abs)
    {
        $val = '';
        if ($abs['stringified']) {
            $val = $abs['stringified'];
        } elseif (isset($abs['methods']['__toString']['returnValue'])) {
            $val = $abs['methods']['__toString']['returnValue'];
        }
        if (!$val) {
            return '';
        }
        $valAppend = '';
        $len = \strlen($val);
        if ($len > 100) {
            $val = \substr($val, 0, 100);
            $valAppend = '&hellip; <i>('.($len - 100).' more chars)</i>';
        }
        $toStringDump = $this->debug->output->html->dump($val);
        $parsed = $this->debug->utilities->parseTag($toStringDump);
        $classArray = \explode(' ', $parsed['attribs']['class']);
        $classArray[] = 't_stringified';
        if ($len > 100) {
            $classArray[] = 't_string_trunc';   // truncated
        }
        $attribs = array(
            'class' => $classArray,
            'title' => isset($parsed['attribs']['title'])
                // ie a timestamp will have a human readable date in title
                ? (!$abs['stringified'] ? '__toString() : ' : '').$parsed['attribs']['title']
                : (!$abs['stringified'] ? '__toString()' : null),
        );
        return $this->debug->utilities->buildTag(
            'span',
            $attribs,
            $parsed['innerhtml'].$valAppend
        )."\n";
    }
protected function dumpToString($abs)
    {
        $val = '';
        if ($abs['stringified']) {
            $val = $abs['stringified'];
        } elseif (isset($abs['methods']['__toString']['returnValue'])) {
            $val = $abs['methods']['__toString']['returnValue'];
        }
        if (!$val) {
            return '';
        }
        $valAppend = '';
        $len = \strlen($val);
        if ($len > 100) {
            $val = \substr($val, 0, 100);
            $valAppend = '&hellip; <i>('.($len - 100).' more chars)</i>';
        }
        $toStringDump = $this->debug->output->html->dump($val);
        $parsed = $this->debug->utilities->parseTag($toStringDump);
        $classArray = \explode(' ', $parsed['attribs']['class']);
        $classArray[] = 't_stringified';
        if ($len > 100) {
            $classArray[] = 't_string_trunc';   // truncated
        }
        $attribs = array(
            'class' => $classArray,
            'title' => isset($parsed['attribs']['title'])
                // ie a timestamp will have a human readable date in title
                ? (!$abs['stringified'] ? '__toString() : ' : '').$parsed['attribs']['title']
                : (!$abs['stringified'] ? '__toString()' : null),
        );
        return $this->debug->utilities->buildTag(
            'span',
            $attribs,
            $parsed['innerhtml'].$valAppend
        )."\n";
    }
Dump object's __toString or stringified value

@param array $abs object abstraction

@return string html