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