original_string: private function getShell()
      {
          if (null !== self::$shell) {
              return self::$shell;
          }
  
          self::$shell = false;
  
          if (file_exists('/usr/bin/env')) {
              // handle other OSs with bash/zsh/ksh/csh if available to hide the answer
              $test = "/usr/bin/env %s -c 'echo OK' 2> /dev/null";
              foreach (array('bash', 'zsh', 'ksh', 'csh') as $sh) {
                  if ('OK' === rtrim(shell_exec(sprintf($test, $sh)))) {
                      self::$shell = $sh;
                      break;
                  }
              }
          }
  
          return self::$shell;
      }
code: private function getShell()
      {
          if (null !== self::$shell) {
              return self::$shell;
          }
  
          self::$shell = false;
  
          if (file_exists('/usr/bin/env')) {
              // handle other OSs with bash/zsh/ksh/csh if available to hide the answer
              $test = "/usr/bin/env %s -c 'echo OK' 2> /dev/null";
              foreach (array('bash', 'zsh', 'ksh', 'csh') as $sh) {
                  if ('OK' === rtrim(shell_exec(sprintf($test, $sh)))) {
                      self::$shell = $sh;
                      break;
                  }
              }
          }
  
          return self::$shell;
      }
code_tokens: private function getShell ( ) { if ( null !== self :: $ shell ) { return self :: $ shell ; } self :: $ shell = false ; if ( file_exists ( '/usr/bin/env' ) ) { // handle other OSs with bash/zsh/ksh/csh if available to hide the answer $ test = "/usr/bin/env %s -c 'echo OK' 2> /dev/null" ; foreach ( array ( 'bash' , 'zsh' , 'ksh' , 'csh' ) as $ sh ) { if ( 'OK' === rtrim ( shell_exec ( sprintf ( $ test , $ sh ) ) ) ) { self :: $ shell = $ sh ; break ; } } } return self :: $ shell ; }
docstring: Returns a valid unix shell.
  
  @return string|bool The valid shell name, false in case no valid shell is found
docstring_tokens: Returns a valid unix shell .