PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Text » Text_Diff » Bug #6699

Text_Diff::reverse() wrong arument for clone

Details

Submitted2006-02-05 22:48 UTC
Fromphp at scarfhogg dot de
Assignedyunosh
StatusClosed
PackageText_Diff
PHP Version5.1.2
Roadmaps(Not assigned)

Comments

[2006-02-05 22:48 UTC] php at scarfhogg dot de

Description:
------------
Text_Diff::reverse() uses $obj instead of this when trying to clone the object when version_compare(zend_version(), '2', '>') evaluates to true

Test script:
---------------
$diff = new Text_Diff($lines1, $lines2);
$diff->reverse();

Expected result:
----------------
get reversed diff

Actual result:
--------------
Warning: __clone method called on non-object in ... Diff.php on line 77
Fatal error: Call to undefined method stdClass::getDiff() in ... Diff/Renderer.php on line 78

line 77 of Diff.php should be

$rev = clone $this;