diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-07-18 14:41:22 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-07-18 14:41:35 +0200 |
commit | 4a9f78f9d79ef999ba51a22ee03da8bdd92356f3 (patch) | |
tree | 5413cf103ab5a1e5fad5f9d08b6597036882c30f /ext/curl/tests | |
parent | 79efd55fc366e3b33c6730f0bfa2cbf9f89d4368 (diff) | |
parent | c8c183eb62b666b5e9c92ca2cbf13f5464ae3aa9 (diff) | |
download | php-git-4a9f78f9d79ef999ba51a22ee03da8bdd92356f3.tar.gz |
Merge branch 'PHP-7.2' into PHP-7.3
Diffstat (limited to 'ext/curl/tests')
-rw-r--r-- | ext/curl/tests/bug77946.phpt | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/ext/curl/tests/bug77946.phpt b/ext/curl/tests/bug77946.phpt new file mode 100644 index 0000000000..c983a77617 --- /dev/null +++ b/ext/curl/tests/bug77946.phpt @@ -0,0 +1,43 @@ +--TEST-- +Bug #77946 (Errored cURL resources returned by curl_multi_info_read() must be compatible with curl_errno() and curl_error()) +--SKIPIF-- +<?php + +if (!extension_loaded('curl')) { + exit('skip curl extension not loaded'); +} + +?> +--FILE-- +<?php +$urls = array( + 'unknown://scheme.tld', +); + +$mh = curl_multi_init(); + +foreach ($urls as $i => $url) { + $conn[$i] = curl_init($url); + curl_multi_add_handle($mh, $conn[$i]); +} + +do { + $status = curl_multi_exec($mh, $active); + $info = curl_multi_info_read($mh); + if (false !== $info) { + var_dump($info['result']); + var_dump(curl_errno($info['handle'])); + var_dump(curl_error($info['handle'])); + } +} while ($status === CURLM_CALL_MULTI_PERFORM || $active); + +foreach ($urls as $i => $url) { + curl_close($conn[$i]); +} + +curl_multi_close($mh); +?> +--EXPECTF-- +int(1) +int(1) +string(%d) "Protocol %Sunknown%S not supported or disabled in libcurl" |