title: Make HTTP/2 request with PHP
body: <p>Is there a way to force PHP to make a HTTP2 connection to another server just to see if that server supports it?</p>
  
  <p>I've tried:</p>
  
  <pre><code>$options = stream_context_create(array(
                 'http' =&gt; array(
                      'method' =&gt; 'GET',
                      'timeout' =&gt; 5,
                      'protocol_version' =&gt; 1.1
                  )
                ));
  $res = file_get_contents($url, false, $options);
  var_dump($http_response_header);
  </code></pre>
  
  <p>And tried:</p>
  
  <pre><code>$ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_HEADER, 1);
  curl_setopt($ch, CURLOPT_NOBODY, 1);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_HTTP_VERSION, 3);
  $response = curl_exec($ch);
  var_dump($response);
  curl_close($ch);
  </code></pre>
  
  <p>But both ways give me a HTTP1.1 response if I use the following URL <code>https://www.google.com/#q=apache+2.5+http%2F2</code></p>
  
  <p>I'm sending the request from a HTTP/2 + SSL enabled domain. What am I doing wrong?</p>