2 pecl/http-v2 - clean with name and id
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 $c = new http\Client("curl", "php.net:80");
18 $c->enqueue(new http\Client\Request("GET", "http://php.net"));
19 } while (count($c) < 3);
23 $h = (array) raphf\stat_persistent_handles();
24 var_dump(array_intersect_key($h, array_flip(preg_grep("/^http/", array_keys($h)))));
27 raphf\clean_persistent_handles("http\\Client\\Curl");
28 raphf\clean_persistent_handles("http\\Client\\Curl\\Request", "php.net:80");
30 $h = (array) raphf\stat_persistent_handles();
31 var_dump(array_intersect_key($h, array_flip(preg_grep("/^http/", array_keys($h)))));
38 ["http\Client\Curl"]=>
48 ["http\Client\Curl\Request"]=>
60 ["http\Client\Curl"]=>
63 ["http\Client\Curl\Request"]=>