function Diff::reverse in Diff 7.3
Same name and namespace in other branches
- 5.2 DiffEngine.php \Diff::reverse()
- 5 DiffEngine.php \Diff::reverse()
- 6.2 DiffEngine.php \Diff::reverse()
- 6 DiffEngine.php \Diff::reverse()
- 7.2 DiffEngine.php \Diff::reverse()
Compute reversed Diff.
SYNOPSIS:
$diff = new Diff($lines1, $lines2); $rev = $diff->reverse();
Return value
object A Diff object representing the inverse of the original diff.
1 call to Diff::reverse()
- Diff::_check in ./
DiffEngine.php - Check a Diff for validity.
File
- ./
DiffEngine.php, line 603 - A PHP diff engine for phpwiki. (Taken from phpwiki-1.3.3)
Class
- Diff
- Class representing a 'diff' between two sequences of strings. @todo document @private @subpackage DifferenceEngine
Code
function reverse() {
$rev = $this;
$rev->edits = array();
foreach ($this->edits as $edit) {
$rev->edits[] = $edit
->reverse();
}
return $rev;
}