original_string: public function withAttribute($name, $value)
      {
          $new = clone $this;
          if (in_array($name, $this->emulatedAttributes, true)) {
              $new->{$name} = $value;
          } else {
              $new->attributes[$name] = $value;
          }
  
          return $new;
      }
code: public function withAttribute($name, $value)
      {
          $new = clone $this;
          if (in_array($name, $this->emulatedAttributes, true)) {
              $new->{$name} = $value;
          } else {
              $new->attributes[$name] = $value;
          }
  
          return $new;
      }
code_tokens: public function withAttribute ( $ name , $ value ) { $ new = clone $ this ; if ( in_array ( $ name , $ this -> emulatedAttributes , true ) ) { $ new -> { $ name } = $ value ; } else { $ new -> attributes [ $ name ] = $ value ; } return $ new ; }
docstring: Return an instance with the specified request attribute.
  
  @param string $name The attribute name.
  @param mixed $value The value of the attribute.
  @return static
docstring_tokens: Return an instance with the specified request attribute .