/** * 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; }