original_string: public static function createTempDir($delete = true, $temp_dir = null)
      {
          if (is_null($temp_dir)) {
              $temp_dir = sys_get_temp_dir();
          }
  
          if (empty($temp_dir)) {
              return false;
          }
  
          /* Get the first 8 characters of a random string to use as a temporary
             directory name. */
          do {
              $new_dir = $temp_dir . '/' . substr(base_convert(uniqid(mt_rand()), 10, 36), 0, 8);
          } while (file_exists($new_dir));
  
          $old_umask = umask(0000);
          if (!mkdir($new_dir, 0700)) {
              $new_dir = false;
          } elseif ($delete) {
              self::deleteAtShutdown($new_dir);
          }
          umask($old_umask);
  
          return $new_dir;
      }
code: public static function createTempDir($delete = true, $temp_dir = null)
      {
          if (is_null($temp_dir)) {
              $temp_dir = sys_get_temp_dir();
          }
  
          if (empty($temp_dir)) {
              return false;
          }
  
          /* Get the first 8 characters of a random string to use as a temporary
             directory name. */
          do {
              $new_dir = $temp_dir . '/' . substr(base_convert(uniqid(mt_rand()), 10, 36), 0, 8);
          } while (file_exists($new_dir));
  
          $old_umask = umask(0000);
          if (!mkdir($new_dir, 0700)) {
              $new_dir = false;
          } elseif ($delete) {
              self::deleteAtShutdown($new_dir);
          }
          umask($old_umask);
  
          return $new_dir;
      }
code_tokens: public static function createTempDir ( $ delete = true , $ temp_dir = null ) { if ( is_null ( $ temp_dir ) ) { $ temp_dir = sys_get_temp_dir ( ) ; } if ( empty ( $ temp_dir ) ) { return false ; } /* Get the first 8 characters of a random string to use as a temporary
             directory name. */ do { $ new_dir = $ temp_dir . '/' . substr ( base_convert ( uniqid ( mt_rand ( ) ) , 10 , 36 ) , 0 , 8 ) ; } while ( file_exists ( $ new_dir ) ) ; $ old_umask = umask ( 0000 ) ; if ( ! mkdir ( $ new_dir , 0700 ) ) { $ new_dir = false ; } elseif ( $ delete ) { self :: deleteAtShutdown ( $ new_dir ) ; } umask ( $ old_umask ) ; return $ new_dir ; }
docstring: Creates a temporary directory in the system's temporary directory.
  
  @param boolean $delete   Delete the temporary directory at the end of
  the request?
  @param string $temp_dir  Use this temporary directory as the directory
  where the temporary directory will be created.
  
  @return string  The pathname to the new temporary directory.
  Returns false if directory not created.
docstring_tokens: Creates a temporary directory in the system s temporary directory .