<period> elements are S-Equal, and <entity> elements are S-Equal, and <scenario> elements are S-Equal.

@param string $c1
@param string $c2

return bool
979032
public static function context_equal( $c1, $c2 )
	{
		if ( is_null( $c1 ) && is_null( $c2 ) ) return true;
		if ( is_null( $c1 ) || is_null( $c2 ) ) return false;

		// Check the arrays have the same elements
		$result = XBRL_Equality::matchedKeyNames( $c1, $c2, array( 'entity', 'period', 'scenario' ) );

		// if ( $result === false || ! is_array( $result ) || ! count( $result ) ) return false;
		if ( $result === false || ! is_array( $result ) ) return false;
		if ( ! count( $result ) ) return true;

		foreach ( $result as $elementName )
		{
			switch ( $elementName )
			{
				case 'entity':

					if ( ! XBRL_Equality::entity_equal( $c1['entity'], $c2['entity'] ) )
					{
						return false;
					}

					break;

				case 'period':

					if ( ! XBRL_Equality::period_equal( $c1['period'], $c2['period'] ) )
					{
						return false;
					}

					break;

				case 'scenario':

					if ( ! XBRL_Equality::segment_equal( $c1['scenario'], $c2['scenario'] ) )
					{
						return false;
					}

					break;
			}
		}

		return true;
	}
802824
public function isActive(&$c)
    {
        if ($c) {
            $cID = ($c->getCollectionPointerID() > 0) ? $c->getCollectionPointerOriginalID() : $c->getCollectionID();

            return $cID == $this->cID;
        }
    }
39482
public static function isEqual($a, $b)
    {
        if ($a === $b) {
            return true;
        } elseif ($a instanceof \stdClass) {
            return self::isEqual((array) $a, $b);
        } elseif ($b instanceof \stdClass) {
            return self::isEqual($a, (array) $b);
        } else {
            return false;
        }
    }
415034
public function equals(Decimal $b, int $scale = null): bool
    {
        self::paramsValidation($b, $scale);

        if ($this === $b) {
            return true;
        } else {
            $cmp_scale = $scale !== null ? $scale : \max($this->scale, $b->scale);

            return (
                \bccomp(
                    self::innerRound($this->value, $cmp_scale),
                    self::innerRound($b->value, $cmp_scale),
                    $cmp_scale
                ) === 0
            );
        }
    }
187490
private function eventsAreEqual($e1, $e2)
    {
        // events aren't equal if they have different classes
        if (get_class($e1) != get_class($e2)) {
            return false;
        }

        // compare their values..
        $reflection = new \ReflectionClass($e1);

        $fields = array_map(function ($property) {
            return $property->name;
        }, $reflection->getProperties());

        $allMatch = true;

        foreach ($fields as $field) {
            // compare the single field across both events
            $property = new \ReflectionProperty(get_class($e1), $field);
            $property->setAccessible(true);
            $e1Value = $property->getValue($e1);
            $e2Value = $property->getValue($e2);

            if (is_array($e1Value)) {
                // this part isn't done, jsut copied, think it through
                for ($i = 0; $i < count($e1Value); $i++) {
                    $setMatches = $this->compareProperties($e1, $e1Value[$i], $e2Value[$i], $property);
                    if ( ! $setMatches) {
                        $allMatch = false;
                    }
                }
            } else {
                $setMatches = $this->compareProperties($e1, $e1Value, $e2Value, $property);
                if ( ! $setMatches) {
                    $allMatch = false;
                }
            }
        }

        return $allMatch;
    }
875670
public function isBetween(Date $dt1, Date $dt2, $equal = true)
    {
        if ($dt1->isAfter($dt2)) {
            $temp = $dt1;
            $dt1 = $dt2;
            $dt2 = $temp;
        }

        if ($equal) {
            return $this->isAfterOrEquals($dt1) && $this->isBeforeOrEquals($dt2);
        }

        return $this->isAfter($dt1) && $this->isBefore($dt2);
    }
216194
static boolean charEqualsIgnoreCase(char c1, char c2) {
        return c1 == c2 ||
                Character.toUpperCase(c1) == Character.toUpperCase(c2) ||
                Character.toLowerCase(c1) == Character.toLowerCase(c2);
    }
645751
static function equals( $entity1, $entity2 ) {
			if ( is_null( $entity1 ) && is_null( $entity2 ) ) {
				return true;
			} else if ( is_object( $entity1 ) && is_object( $entity2 ) ) {
				return ( $entity1->id == $entity2->id );
			} else if ( is_object( $entity1 ) ) {
				return is_null( $entity1->id );
			} else {
				return is_null( $entity2->id );
			}
		}
541888
public function isEqualTo(QDateTime $dttCompare)
    {
        // All comparison operations MUST have operands with matching Date Nullstates
        if ($this->blnDateNull != $dttCompare->blnDateNull) {
            return false;
        }

        // If mismatched Time nullstates, then only compare the Date portions
        if ($this->blnTimeNull != $dttCompare->blnTimeNull) {
            // Let's "Null Out" the Time
            $dttThis = new QDateTime($this);
            $dttThat = new QDateTime($dttCompare);
            $dttThis->Hour = null;
            $dttThat->Hour = null;

            // Return the Result
            return ($dttThis->Timestamp == $dttThat->Timestamp);
        } else {
            // Return the Result for the both Date and Time components
            return ($this->Timestamp == $dttCompare->Timestamp);
        }
    }
542417
public function areEqual(RepetitionInterface $r1, RepetitionInterface $r2)
    {
        if ($r1->getStartDate() != $r2->getStartDate()) {
            return false;
        }

        if ($r1->getTimezone()->getName() != $r2->getTimezone()->getName()) {
            return false;
        }

        if ($r1->getEndDate() != $r2->getEndDate()) {
            return false;
        }

        if ($r1->isStartDateAllDay() != $r2->isStartDateAllDay()) {
            return false;
        }

        if ($r1->isEndDateAllDay() != $r2->isEndDateAllDay()) {
            return false;
        }

        if ($r1->getRepeatPeriod() != $r2->getRepeatPeriod()) {
            return false;
        }

        if ($r1->getRepeatMonthBy() != $r2->getRepeatMonthBy()) {
            return false;
        }

        if ($r1->getRepeatEveryNum() != $r2->getRepeatEveryNum()) {
            return false;
        }

        if ($r1->getRepeatPeriodEnd() != $r2->getRepeatPeriodEnd()) {
            return false;
        }

        foreach($r1->getRepeatPeriodWeekDays() as $weekDay) {
            if (!in_array($weekDay, $r2->getRepeatPeriodWeekDays())) {
                return false;
            }
        }

        if ($r1->getRepeatPeriodWeekDays() != $r2->getRepeatPeriodWeekDays()) {
        }return true;
    }
210951
public function prune($c2P = null)
    {
        if ($c2P) {
            $this->addCond('pruneCond0', $this->getAliasedColName(C2PTableMap::COL_CATEGORY_ID), $c2P->getCategoryId(), Criteria::NOT_EQUAL);
            $this->addCond('pruneCond1', $this->getAliasedColName(C2PTableMap::COL_PAGE_ID), $c2P->getPageId(), Criteria::NOT_EQUAL);
            $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
        }

        return $this;
    }
480881
public final boolean contains(char c1, char c2) {
    try {
      String s = new String(new String(new char[]{c1, c2}).getBytes(enc), enc);
      return s.length() == 2 && s.charAt(0) == c1 && s.charAt(1) == c2;
    }
    catch (UnsupportedEncodingException e) {
      return false;
    }
    // work around gcj bug (libgcj/9802)
    catch (RuntimeException e) {
      return false;
    }
  }
1116980
public function equals(Vector $v) {
		if($this->dimension != $v->getDimensions()) {
			throw new Exception("Both vectors must have the same size");
		}

		$otherComponents = $v->toArray();
		$ret = true;
		for($i = 0; $ret && $i < $this->dimension; ++$i) {
			$ret = ($this->components[$i] == $otherComponents[$i]);
		}
		return $ret;
	}
579378
public function or_on($c1, $op, $c2)
	{
		$this->_on[] = array($c1, $op, $c2, 'OR');

		return $this;
	}
895714
protected function NodeEqual( $nav1, $nav2 )
	{
		if ( $nav1->getNodeType() != $nav2->getNodeType() )
		{
			return false;
		}

		switch ( $nav1->getNodeType() )
		{
			case XPathNodeType::Element:
				return $this->ElementEqual( $nav1, $nav2 );

			case XPathNodeType::Attribute:
				return $this->AttributeEqual( $nav1, $nav2 );

			case XPathNodeType::Text:
			case XPathNodeType::SignificantWhitespace:
			case XPathNodeType::Whitespace:
			case XPathNodeType::Comment:

				if ( $this->useValueCompare )
				{
					if ( $nav1->getValue() == $nav2->getValue() )
					{
						// return true;
					}
					$value = $nav1->getValue();
					$result = $this->ItemEqual( $nav1, $nav2);
					return $result;
				}
				else
				{
					return $this->TextEqual( $nav1->getValue(), $nav2->getValue() );
				}

			case XPathNodeType::ProcessingInstruction:
				return $this->ProcessingInstructionEqual( $nav1, $nav2 );

			default:
				return $this->DeepEqualByNavigator( $nav1, $nav2 );
		}
	}
781321
static boolean isRelationalOperation(Node n) {
    switch (n.getToken()) {
      case GT: // equal
      case GE: // not equal
      case LT: // exactly equal
      case LE: // exactly not equal
        return true;
      default:
        break;
    }
    return false;
  }
421387
protected boolean verifyCondition1(IContextMapping<INode> mapping, IMappingElement<INode> e) {
        return findRelation(IMappingElement.LESS_GENERAL, e.getSource().getAncestors(), e.getTarget(), mapping) ||
                findRelation(IMappingElement.EQUIVALENCE, e.getSource().getAncestors(), e.getTarget(), mapping) ||

                findRelation(IMappingElement.LESS_GENERAL, e.getSource(), e.getTarget().getDescendants(), mapping) ||
                findRelation(IMappingElement.EQUIVALENCE, e.getSource(), e.getTarget().getDescendants(), mapping) ||

                findRelation(IMappingElement.LESS_GENERAL, e.getSource().getAncestors(), e.getTarget().getDescendants(), mapping) ||
                findRelation(IMappingElement.EQUIVALENCE, e.getSource().getAncestors(), e.getTarget().getDescendants(), mapping);
    }