public function rand($num = 1)
    {
        try {
            $arr = array_rand($this->val(), $num);
        } catch (\ErrorException $e) {
            throw new ArrayObjectException($e->getMessage());
        }

        if (!$this->isArray($arr)) {
            $arr = [$arr];
        }

        return new ArrayObject($arr);
    }