original_string: public function set_tags($tags) {
          $this->tags = [];
          foreach ($tags as $tag) {
              // We use $tag->id as the key for the array so not only it handles duplicates of the same tag being given,
              // but also it is consistent with the behaviour of set_tags_by_id() below.
              $this->tags[$tag->id] = $tag;
          }
      }
code: public function set_tags($tags) {
          $this->tags = [];
          foreach ($tags as $tag) {
              // We use $tag->id as the key for the array so not only it handles duplicates of the same tag being given,
              // but also it is consistent with the behaviour of set_tags_by_id() below.
              $this->tags[$tag->id] = $tag;
          }
      }
code_tokens: public function set_tags ( $ tags ) { $ this -> tags = [ ] ; foreach ( $ tags as $ tag ) { // We use $tag->id as the key for the array so not only it handles duplicates of the same tag being given, // but also it is consistent with the behaviour of set_tags_by_id() below. $ this -> tags [ $ tag -> id ] = $ tag ; } }
docstring: Set some tags for this quiz slot.
  
  @param \core_tag_tag[] $tags
docstring_tokens: Set some tags for this quiz slot .