1--TEST--
2Basic curl_share test
3--FILE--
4<?php
5
6$sh = curl_share_init();
7
8$ch1 = curl_init();
9curl_setopt($ch1, CURLOPT_URL, 'file://' . __DIR__ . '/curl_testdata1.txt');
10curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
11curl_setopt($ch1, CURLOPT_SHARE, $sh);
12
13$ch2 = curl_init();
14curl_setopt($ch2, CURLOPT_URL, 'file://' . __DIR__ . '/curl_testdata2.txt');
15curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
16curl_setopt($ch2, CURLOPT_SHARE, $sh);
17
18// Make sure nothing bad handles if the share handle is unset early.
19unset($sh);
20
21var_dump(curl_exec($ch1));
22var_dump(curl_exec($ch2));
23
24?>
25--EXPECT--
26string(6) "CURL1
27"
28string(6) "CURL2
29"
30