1--TEST--
2Test curl_copy_handle() with CURLINFO_HEADER_OUT
3--EXTENSIONS--
4curl
5--FILE--
6<?php
7  include 'server.inc';
8  $host = curl_cli_server_start();
9
10  $url = "{$host}/get.inc";
11  $ch = curl_init($url);
12
13  curl_setopt($ch, CURLINFO_HEADER_OUT, 1);
14  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
15  $ch2 = curl_copy_handle($ch);
16  echo curl_exec($ch), PHP_EOL;
17  var_dump(strstr(curl_getinfo($ch, CURLINFO_HEADER_OUT), "\r", true));
18  unset($ch);
19  echo curl_exec($ch2), PHP_EOL;
20  var_dump(strstr(curl_getinfo($ch2, CURLINFO_HEADER_OUT), "\r", true));
21
22?>
23--EXPECT--
24Hello World!
25Hello World!
26string(21) "GET /get.inc HTTP/1.1"
27Hello World!
28Hello World!
29string(21) "GET /get.inc HTTP/1.1"
30