Why do you need a negative timeout ? it doesn't make any sense. Either curl gets the page and quits or wait until the it's completes loading, for that you use a POSITIVE value, bellow it's an example on how to use curl with timeout:
$ch = curl_init('http://site/test/test_timeout.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_NOSIGNAL, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 5); //timeout in seconds - You can use 0 for infinite timeout
/* You can also use
curl_setopt($ch, CURLOPT_TIMEOUT_MS, 5000); //timeout in miliseconds (5 seconds)
*/
$data = curl_exec($ch);
$curl_errno = curl_errno($ch);
$curl_error = curl_error($ch);
curl_close($ch);
Curl Timeout Options:
CURLOPT_TIMEOUT
The number of seconds to wait while trying to connect. Use 0 to wait indefinitely.
CURLOPT_TIMEOUT_MS
The number of milliseconds to wait while trying to connect. Use 0 to wait indefinitely. If libcurl is built to use the standard system name resolver, that portion of the connect will still use full-second resolution for timeouts with a minimum timeout allowed of one second. Added in cURL 7.16.2. Available since PHP 5.2.3.