code: public function setOpt($name, $value = null)
    {
      if(is_array($name))
      {
        try
        {
          $i = 0;
          foreach($name as $opt => $value)
          {
            $this->setOpt($opt, $value);
            ++$i;
          }
        }
        catch(CurlException $e)
        {
          throw $e->getCode() ? $e : new CurlException("Set failed at #$i: " . $e->getMessage());
        }
      }
      else
      {
        try
        {
          set_error_handler(
            function($s, $m, $f, $l, $c = null)
            use($name)
            {
              throw new CurlException("$m (" . CurlOptions::name($name) . ").");
            },
            \E_WARNING
          );
          $this->perform('curl_setopt', $name, $value);
        }
        finally
        {
          restore_error_handler();
        }
      }
    }
docs: Setting cURL options.
  
  @see \curl_setopt()
  
  @param int|array $name A CURLOPT_* constant or an array of option:value pairs.
  @param ?mixed $value The value to set the option to.
  @return void