protected static function _compareKeyValues($o1, $o2, $key) {
    if(property_exists($o1, $key)) {
      return property_exists($o2, $key) && $o1->{$key} === $o2->{$key};
    }
    return !property_exists($o2, $key);
  }
protected static function _compareKeyValues($o1, $o2, $key) {
    if(property_exists($o1, $key)) {
      return property_exists($o2, $key) && $o1->{$key} === $o2->{$key};
    }
    return !property_exists($o2, $key);
  }
protected static function _compareKeyValues ( $ o1 , $ o2 , $ key ) { if ( property_exists ( $ o1 , $ key ) ) { return property_exists ( $ o2 , $ key ) && $ o1 -> { $ key } === $ o2 -> { $ key } ; } return ! property_exists ( $ o2 , $ key ) ; }
Returns true if both of the given objects have the same value for the
given key or if neither of the objects contain the given key.

@param stdClass $o1 the first object.
@param stdClass $o2 the second object.
@param string key the key to check.

@return bool true if both objects have the same value for the key or
neither has the key.
Returns true if both of the given objects have the same value for the given key or if neither of the objects contain the given key .