original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Checks whether the given choices can be cast to strings without
  generating duplicates.
  This method is responsible for preventing conflict between scalar values
  and the empty value.
  
  @param array      $choices The choices
  @param array|null $cache   The cache for previously checked entries. Internal
  
  @return bool returns true if the choices can be cast to strings and
  false otherwise
docstring_tokens: Checks whether the given choices can be cast to strings without generating duplicates . This method is responsible for preventing conflict between scalar values and the empty value .