HTMLPurifier_Length::compareTo PHP Method

compareTo() public method

Compares two lengths, and returns 1 if greater, -1 if less and 0 if equal.
public compareTo ( HTMLPurifier_Length $l ) : integer
$l HTMLPurifier_Length
return integer
    public function compareTo($l)
    {
        if ($l === false) {
            return false;
        }
        if ($l->unit !== $this->unit) {
            $converter = new HTMLPurifier_UnitConverter();
            $l = $converter->convert($l, $this->unit);
            if ($l === false) {
                return false;
            }
        }
        return $this->n - $l->n;
    }