You are here

public function SassNumber::op_eq in Sassy 7

Same name and namespace in other branches
  1. 7.3 phpsass/script/literals/SassNumber.php \SassNumber::op_eq()

* The SassScript == operation. *

Return value

SassBoolean SassBoolean object with the value true if the values * of this and other are equal, false if they are not

Overrides SassLiteral::op_eq

File

phamlp/sass/script/literals/SassNumber.php, line 206

Class

SassNumber
SassNumber class. Provides operations and type testing for Sass numbers. Units are of the passed value are converted the those of the class value if it has units. e.g. 2cm + 20mm = 4cm while 2 + 20mm =…

Code

public function op_eq($other) {
  if (!$other instanceof SassNumber) {
    return new SassBoolean(false);
  }
  try {
    return new SassBoolean($this->value == $this
      ->convert($other)->value);
  } catch (Exception $e) {
    return new SassBoolean(false);
  }
}