本文整理汇总了PHP中SimpleDumper::describeDifference方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleDumper::describeDifference方法的具体用法?PHP SimpleDumper::describeDifference怎么用?PHP SimpleDumper::describeDifference使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleDumper
的用法示例。
在下文中一共展示了SimpleDumper::describeDifference方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: describeDifference
/**
* Creates a human readable description of the
* difference between two variables. Uses a
* dynamic call.
* @param mixed $first First variable.
* @param mixed $second Value to compare with.
* @param boolean $identical If true then type anomolies count.
* @return string Description of difference.
* @access public
*/
function describeDifference($first, $second, $identical = false)
{
$difference = parent::describeDifference($first, $second, $identical);
$difference = htmlentities($difference, ENT_COMPAT, 'UTF-8');
if ($this->getType($first) == 'String') {
$diff = $this->describeStringDifferenceAsADiff($first, $second, $identical);
if ($diff) {
$difference .= PHP_EOL . PHP_EOL;
$difference .= '<fieldset><legend>Unified diff</legend>';
$difference .= '<div class="diff">' . $diff . '</div>';
$difference .= '</fieldset>';
}
}
return $difference;
}