xref: /PHP-7.0/ext/curl/tests/bug71523.phpt (revision d6457065)
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}
8if (getenv("SKIP_ONLINE_TESTS")) {
9	die("skip online test");
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--EXPECTF--
31okey
32