public static function compare($val1, $val2)
    {
        if(in_array(self::getQualifiedType($val1), array('int','boolean', 'float', 'NULL')) )
            return $val1 == $val2 ? 0 : (($val1 < $val2) ? -1 : 1);
        // if(self::getQualifiedType($val1) == 'string' )
            // return strcmp($val1, $val2);
        if(self::isSubclass($val1, 'Date'))
            return self::compare($val1->toUnix(), $val2->toUnix());

        return strcmp((string)$val1, (string)$val2);
    }