original_string: protected function _isSelected($key, $selected)
      {
          if ($selected === null) {
              return false;
          }
          $isArray = is_array($selected);
          if (!$isArray) {
              $selected = $selected === false ? '0' : $selected;
  
              return (string)$key === (string)$selected;
          }
          $strict = !is_numeric($key);
  
          return in_array((string)$key, $selected, $strict);
      }
code: protected function _isSelected($key, $selected)
      {
          if ($selected === null) {
              return false;
          }
          $isArray = is_array($selected);
          if (!$isArray) {
              $selected = $selected === false ? '0' : $selected;
  
              return (string)$key === (string)$selected;
          }
          $strict = !is_numeric($key);
  
          return in_array((string)$key, $selected, $strict);
      }
code_tokens: protected function _isSelected ( $ key , $ selected ) { if ( $ selected === null ) { return false ; } $ isArray = is_array ( $ selected ) ; if ( ! $ isArray ) { $ selected = $ selected === false ? '0' : $ selected ; return ( string ) $ key === ( string ) $ selected ; } $ strict = ! is_numeric ( $ key ) ; return in_array ( ( string ) $ key , $ selected , $ strict ) ; }
docstring: Helper method for deciding what options are selected.
  
  @param string $key The key to test.
  @param array|string|null $selected The selected values.
  @return bool
docstring_tokens: Helper method for deciding what options are selected .