WordPress at Your Fingertips
function is not described

Text_Diff::reverse() public WP 1.0

Computes a reversed diff.


$diff = new Text_Diff($lines1, $lines2);
$rev = $diff->reverse();

{} It's a method of the class: Text_Diff{}

No Hooks.


Text_Diff. A Diff object representing the inverse of the original diff. Note that we purposely don't return a reference here, since this essentially is a clone() method.


$Text_Diff = new Text_Diff();

Code of Text_Diff::reverse() WP 5.8.3

function reverse()
    if (version_compare(zend_version(), '2', '>')) {
        $rev = clone($this);
    } else {
        $rev = $this;
    $rev->_edits = array();
    foreach ($this->_edits as $edit) {
        $rev->_edits[] = $edit->reverse();
    return $rev;