1--TEST--
2curl_share_errno and curl_share_strerror basic test
3--SKIPIF--
4<?php
5if (!extension_loaded("curl")) {
6        exit("skip curl extension not loaded");
7}
8?>
9--FILE--
10<?php
11
12$sh = curl_share_init();
13$errno = curl_share_errno($sh);
14echo $errno . PHP_EOL;
15echo curl_share_strerror($errno) . PHP_EOL;
16
17try {
18    curl_share_setopt($sh, -1, -1);
19} catch (ValueError $e) {
20    echo $e->getMessage(), "\n";
21}
22
23$errno = curl_share_errno($sh);
24echo $errno . PHP_EOL;
25echo curl_share_strerror($errno) . PHP_EOL;
26?>
27--EXPECT--
280
29No error
30curl_share_setopt(): Argument #2 ($option) is not a valid cURL share option
311
32Unknown share option
33