private function castableToString(array $choices, array &$cache = [])
    {
        foreach ($choices as $choice) {
            if (\is_array($choice)) {
                if (!$this->castableToString($choice, $cache)) {
                    return false;
                }

                continue;
            } elseif (!is_scalar($choice)) {
                return false;
            }

            // prevent having false casted to the empty string by isset()
            $choice = false === $choice ? '0' : (string) $choice;

            if (isset($cache[$choice])) {
                return false;
            }

            $cache[$choice] = true;
        }

        return true;
    }