HTTP(S) Stream with curlwrappers

ストリーム関数をいろいろ試していて、HTTP で(ほとんどの人は無視していいと思うけど)困ったことがあったのでメモ。
普通にコンパイルした PHP ではマニュアルにあるとおりにレスポンスヘッダが取れるんだけど、

% php -r '$stm = fopen("http://localhost/", "r"); print_r(stream_get_meta_data($stm));'
Array
(
    [wrapper_data] => Array
        (
            [0] => HTTP/1.1 200 OK
            [1] => Date: Fri, 03 Feb 2006 15:39:50 GMT
            [2] => Server: Apache/1.3.33 (Darwin)
            [3] => Content-Location: index.html.en
            [4] => Vary: negotiate,accept-language,accept-charset
            [5] => TCN: choice
            [6] => Last-Modified: Fri, 04 May 2001 00:00:38 GMT
            [7] => ETag: "6e21-5b0-3af1f126;43e1d365"
            [8] => Accept-Ranges: bytes
            [9] => Content-Length: 1456
            [10] => Connection: close
            [11] => Content-Type: text/html
            [12] => Content-Language: en
            [13] => Expires: Fri, 03 Feb 2006 15:39:50 GMT
        )

    [wrapper_type] => http
    [stream_type] => tcp_socket/ssl
    [mode] => r+
    [unread_bytes] => 1456
    [seekable] => 
    [uri] => http://localhost/
    [timed_out] => 
    [blocked] => 1
    [eof] => 
)

configure のオプションに --with-curlwrappers をつけてコンパイルした PHP では

% ~/Applications/php51-curl/bin/php -r '$stm = fopen("http://localhost/", "r");
$meta = stream_get_meta_data($stm);
print_r($meta);
print_r(stream_get_meta_data($meta["wrapper_data"]["readbuf"]));'
Array
(
    [wrapper_data] => Array
        (
            [headers] => Array
                (
                )

            [readbuf] => Resource id #6
        )

    [wrapper_type] => cURL
    [stream_type] => cURL
    [mode] => r
    [unread_bytes] => 0
    [seekable] => 
    [uri] => http://localhost/
    [timed_out] => 
    [blocked] => 1
    [eof] => 
)
Array
(
    [stream_type] => TEMP
    [mode] => w+b
    [unread_bytes] => 0
    [seekable] => 1
    [timed_out] => 
    [blocked] => 1
    [eof] => 
)

と、さっぱり情報が取れない。
手を抜きたいときに fopen-urlwrapper はすごく便利なので --with-curlwrappers は指定しないことにしよう。
あと、機能と処理速度の両方が良さそうで期待している PECLpecl_http がバージョンアップしてたけど、まだ make が通らない...