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 $h = (array) raphf\stat_persistent_handles();
17 var_dump(array_intersect_key($h, array_flip(preg_grep("/^http/", array_keys($h)))));
19 $c = new http\Client("curl", "php.net:80");
20 $c2 = new http\Client("curl", "php.net:80");
22 $c->enqueue(new http\Client\Request("GET", "http://php.net"));
23 $c2->enqueue(new http\Client\Request("GET", "http://php.net"));
24 } while (count($c) < 3);
26 $h = (array) raphf\stat_persistent_handles();
27 var_dump(array_intersect_key($h, array_flip(preg_grep("/^http/", array_keys($h)))));
31 $h = (array) raphf\stat_persistent_handles();
32 var_dump(array_intersect_key($h, array_flip(preg_grep("/^http/", array_keys($h)))));
34 raphf\clean_persistent_handles();
36 $h = (array) raphf\stat_persistent_handles();
37 var_dump(array_intersect_key($h, array_flip(preg_grep("/^http/", array_keys($h)))));
44 ["http\Client\Curl"]=>
47 ["http\Client\Curl\Request"]=>
52 ["http\Client\Curl"]=>
62 ["http\Client\Curl\Request"]=>
74 ["http\Client\Curl"]=>
84 ["http\Client\Curl\Request"]=>
96 ["http\Client\Curl"]=>
106 ["http\Client\Curl\Request"]=>