code: public static function cascade(array $folders)
      {
          $result = null;
          foreach ($folders as $folder) {
              if (is_dir($folder)) {
                  $result = $folder;
  
                  break;
              }
          }
  
          return $result;
      }
docs: Parses given folders and returns the first existing one
  
  @param array $folder
  
  @return null|string