source: src/router/php7/ext/curl/tests/curl_multi_info_read.phpt @ 31874

Last change on this file since 31874 was 31874, checked in by brainslayer, 4 months ago

update php

File size: 872 bytes
Line 
1--TEST--
2array curl_multi_info_read ( resource $mh [, int &$msgs_in_queue = NULL ] );
3--CREDITS--
4marcosptf - <marcosptf@yahoo.com.br> - @phpsp - sao paulo - br
5--SKIPIF--
6<?php
7if (getenv("SKIP_ONLINE_TESTS")) { die('skip: online test'); }
8if (!extension_loaded('curl')) { print("skip"); }
9?>
10--FILE--
11<?php
12$urls = array(
13    "bugs.php.net",
14    "pear.php.net"
15);
16
17$mh = curl_multi_init();
18foreach ($urls as $i => $url) {
19    $conn[$i] = curl_init($url);
20    curl_setopt($conn[$i], CURLOPT_RETURNTRANSFER, 1);
21    curl_multi_add_handle($mh, $conn[$i]);
22}
23
24do {
25    $status = curl_multi_exec($mh, $active);
26    $info = curl_multi_info_read($mh);
27    if (false !== $info) {
28        var_dump(is_array($info));
29    }
30} while ($status === CURLM_CALL_MULTI_PERFORM || $active);
31
32foreach ($urls as $i => $url) {
33    curl_close($conn[$i]);
34}
35?>
36--EXPECT--
37bool(true)
38bool(true)
Note: See TracBrowser for help on using the repository browser.