xref: /PHP-8.0/ext/curl/tests/bug71523.phpt (revision c5401854)
1--TEST--
2Bug #71523 (Copied handle with new option CURLOPT_HTTPHEADER crashes while curl_multi_exec)
3--SKIPIF--
4<?php
5if (!extension_loaded("curl")) {
6    exit("skip curl extension not loaded");
7}
8?>
9--FILE--
10<?php
11
12$base = curl_init('http://www.google.com/');
13curl_setopt($base, CURLOPT_RETURNTRANSFER, true);
14$mh = curl_multi_init();
15
16for ($i = 0; $i < 2; ++$i) {
17    $ch = curl_copy_handle($base);
18    curl_setopt($ch, CURLOPT_HTTPHEADER, ['Foo: Bar']);
19    curl_multi_add_handle($mh, $ch);
20}
21
22do {
23    curl_multi_exec($mh, $active);
24} while ($active);
25?>
26okey
27--EXPECT--
28okey
29