xref: /PHP-8.4/ext/curl/tests/curl_progress.phpt (revision f4dbe239)
1--TEST--
2Test curl_copy_handle() with CURLOPT_PROGRESSFUNCTION
3--EXTENSIONS--
4curl
5--FILE--
6<?php
7include 'server.inc';
8$host = curl_cli_server_start();
9
10$url = "{$host}/get.inc";
11$ch = curl_init($url);
12curl_setopt($ch, CURLOPT_NOPROGRESS, 0);
13curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
14curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, function() { });
15$ch2 = curl_copy_handle($ch);
16echo curl_exec($ch), PHP_EOL;
17unset($ch);
18echo curl_exec($ch2);
19
20?>
21--EXPECT--
22Hello World!
23Hello World!
24Hello World!
25Hello World!
26