public static function getTypeByValue($value)
    {
        if (is_int($value)) {
            return self::TYPE_INT;
        } elseif (is_string($value)) {
            return self::TYPE_QSTRING;
        } elseif (is_bool($value)) {
            return self::TYPE_BOOL;
        } elseif (self::isList($value)) {
            return self::TYPE_QVARIANT_LIST;
        } elseif (self::isMap($value)) {
            return self::TYPE_QVARIANT_MAP;
        } elseif ($value instanceof \DateTime) {
            return self::TYPE_QDATETIME;
        } else {
            throw new \InvalidArgumentException('Can not guess variant type for type "' . gettype($value) . '"');
        }
    }