2 pecl/http-v2 - partial clean
5 if (!extension_loaded("http")) {
6 die("skip pecl/http needed");
8 if (!class_exists("http\\Client", false)) {
9 die("skip pecl/http-v2 with curl support needed");
16 var_dump(raphf\stat_persistent_handles());
18 $c = new http\Client("curl", "php.net:80");
19 $c2 = new http\Client("curl", "php.net:80");
21 $c->enqueue(new http\Client\Request("GET", "http://php.net"));
22 $c2->enqueue(new http\Client\Request("GET", "http://php.net"));
23 } while (count($c) < 3);
25 var_dump(raphf\stat_persistent_handles());
29 var_dump(raphf\stat_persistent_handles());
31 raphf\clean_persistent_handles();
33 var_dump(raphf\stat_persistent_handles());
39 object(stdClass)#%d (2) {
40 ["http\Client\Curl"]=>
43 ["http\Client\Curl\Request"]=>
47 object(stdClass)#%d (2) {
48 ["http\Client\Curl"]=>
58 ["http\Client\Curl\Request"]=>
69 object(stdClass)#%d (2) {
70 ["http\Client\Curl"]=>
80 ["http\Client\Curl\Request"]=>
91 object(stdClass)#%d (2) {
92 ["http\Client\Curl"]=>
102 ["http\Client\Curl\Request"]=>