original_string: public function save($dom, $file, $options = array()) {
          $close = true;
          if (is_resource($file)) {
              $stream = $file;
              $close = false;
          } else {
              $stream = fopen($file, 'w');
          }
          $options = array_merge($this->getOptions(), $options);
          $rules = new HTML5_Serializer_OutputRules($stream, $options);
          $trav = new HTML5_Serializer_Traverser($dom, $stream, $rules, $options);
  
          $trav->walk();
  
          if ($close) {
              fclose($stream);
          }
      }
code: public function save($dom, $file, $options = array()) {
          $close = true;
          if (is_resource($file)) {
              $stream = $file;
              $close = false;
          } else {
              $stream = fopen($file, 'w');
          }
          $options = array_merge($this->getOptions(), $options);
          $rules = new HTML5_Serializer_OutputRules($stream, $options);
          $trav = new HTML5_Serializer_Traverser($dom, $stream, $rules, $options);
  
          $trav->walk();
  
          if ($close) {
              fclose($stream);
          }
      }
code_tokens: public function save ( $ dom , $ file , $ options = array ( ) ) { $ close = true ; if ( is_resource ( $ file ) ) { $ stream = $ file ; $ close = false ; } else { $ stream = fopen ( $ file , 'w' ) ; } $ options = array_merge ( $ this -> getOptions ( ) , $ options ) ; $ rules = new HTML5_Serializer_OutputRules ( $ stream , $ options ) ; $ trav = new HTML5_Serializer_Traverser ( $ dom , $ stream , $ rules , $ options ) ; $ trav -> walk ( ) ; if ( $ close ) { fclose ( $ stream ) ; } }
docstring: Save a DOM into a given file as HTML5.
  
  @param mixed $dom
  The DOM to be serialized.
  @param string $file
  The filename to be written.
  @param array $options
  Configuration options when serializing the DOM. These include:
  - encode_entities: Text written to the output is escaped by default and not all
  entities are encoded. If this is set to true all entities will be encoded.
  Defaults to false.
docstring_tokens: Save a DOM into a given file as HTML5 .