title: PHP curl failing to resolve IPv6-only URL
body: <p>I'm trying to get data from <code>http://ipv6.test-ipv6.com</code>, which only has AAAA IPv6 record (no IPv4). I can get the data from command line like <code>curl -v http://ipv6.test-ipv6.com</code> (shows that the IP is resolved properly). I also tried <code>dig AAAA ipv6.test-ipv6.com @127.0.0.1</code> and it works fine, as well as getting the data when I specify the IP in PHP curl call: <code>$ch = curl_init('http://[2001:470:1:18::119]');</code>. But specifically using the IPv6-only hostname fails. How do I fix this?</p>
  
  <p>Code:</p>
  
  <pre><code>&lt;?php
  
  $ch = curl_init('http://ipv6.test-ipv6.com');
  //$ch = curl_init('http://[2001:470:1:18::119]');
  curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_VERSION_IPV6);
  curl_setopt($ch, CURLOPT_VERBOSE, true);
  curl_setopt($ch, CURLOPT_HEADER, true);
  curl_exec($ch);
  </code></pre>
  
  <p>Actually by the looks of it, the problem is with <code>CURLOPT_IPRESOLVE</code> options - it works without that option. What I want to achieve is to get curl to use IPv6 address or fail if it's unavailable. Isn't that what <code>CURLOPT_IPRESOLVE</code> should do?</p>