xref: /PHP-8.2/ext/curl/tests/bug71523.phpt (revision 0bdc4b8c)
1--TEST--
2Bug #71523 (Copied handle with new option CURLOPT_HTTPHEADER crashes while curl_multi_exec)
3--EXTENSIONS--
4curl
5--SKIPIF--
6<?php
7if (curl_version()['version_number'] === 0x080a00) {
8    // https://github.com/php/php-src/issues/15997
9    die('xfail due to a libcurl bug');
10}
11?>
12--FILE--
13<?php
14
15$base = curl_init('http://www.google.com/');
16curl_setopt($base, CURLOPT_RETURNTRANSFER, true);
17$mh = curl_multi_init();
18
19for ($i = 0; $i < 2; ++$i) {
20    $ch = curl_copy_handle($base);
21    curl_setopt($ch, CURLOPT_HTTPHEADER, ['Foo: Bar']);
22    curl_multi_add_handle($mh, $ch);
23}
24
25do {
26    curl_multi_exec($mh, $active);
27} while ($active);
28?>
29okey
30--EXPECT--
31okey
32