E. Myers, U. Manber, and W. Miller, "An O(NP) Sequence Comparison Algorithm," Information Processing Letters 35, 6 (1990), 317-323. */ class WikiDiffLine { var $text; var $status; var $who; // who originally wrote this line? function __construct($text, $who = null) { $this->text = "$text\n"; $this->who = $who; $this->status = []; } function compare($obj) { return $this->text == $obj->text; } function set($key,$status) { $this->status[$key] = $status; } function get($key) { return array_key_exists($key,$this->status) ? $this->status[$key] : ''; } function merge($obj) { $this->status += $obj->status; } function text() { return $this->text; } }