1--TEST--
2Test curl_copy_handle() with CURLOPT_PROGRESSFUNCTION
3--SKIPIF--
4<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable"; ?>
5--FILE--
6<?php
7  $host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
8
9  $url = "{$host}/get.php";
10  $ch = curl_init($url);
11
12  curl_setopt($ch, CURLOPT_NOPROGRESS, 0);
13  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
14  curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, function() { });
15  $ch2 = curl_copy_handle($ch);
16  echo curl_exec($ch), PHP_EOL;
17  unset($ch);
18  echo curl_exec($ch2);
19
20?>
21--EXPECTF--
22Hello World!
23Hello World!
24Hello World!
25Hello World!
26