本文整理匯總了PHP中DOMNode::evaluate方法的典型用法代碼示例。如果您正苦於以下問題:PHP DOMNode::evaluate方法的具體用法?PHP DOMNode::evaluate怎麽用?PHP DOMNode::evaluate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DOMNode
的用法示例。
在下文中一共展示了DOMNode::evaluate方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: renderEntries
private function renderEntries(\DOMNode $trace, $table, array $options, $padding = 0)
{
$totalTime = $trace->evaluate('number(/trace/entry[1]/@end-time) - number(/trace/entry[1]/@start-time)') * 1000000.0;
foreach ($trace->query('./entry') as $entryEl) {
if (null === $options['filter'] || preg_match('{' . $options['filter'] . '}', $entryEl->getAttribute('function'))) {
$timeInc = ($entryEl->getAttribute('end-time') - $entryEl->getAttribute('start-time')) * 1000000.0;
$table->addRow([$entryEl->getAttribute('func_nb'), $entryEl->getAttribute('level'), number_format($entryEl->getAttribute('start-memory')) . 'b', $entryEl->getAttribute('start-time') . 's', $this->timeUnit->format($timeInc, array_merge($this->timeUnit->getDefaultOptions(), ['precision' => 0])), number_format($timeInc / $totalTime * 100, 2), $this->renderFunction($entryEl, $padding, $options), sprintf('%s:%s', str_replace(getcwd(), '.', $entryEl->getAttribute('filename')), $entryEl->getAttribute('line'))]);
}
$this->renderEntries($entryEl, $table, $options, $padding + 1);
}
}