<?php
echo "Test\n";
-var_dump(raphf\stat_persistent_handles());
+$h = (array) raphf\stat_persistent_handles();
+var_dump(array_intersect_key($h, array_flip(preg_grep("/^http/", array_keys($h)))));
$c = new http\Client("curl", "php.net:80");
do {
$c->enqueue(new http\Client\Request("GET", "http://php.net"));
} while (count($c) < 3);
-var_dump(raphf\stat_persistent_handles());
+$h = (array) raphf\stat_persistent_handles();
+var_dump(array_intersect_key($h, array_flip(preg_grep("/^http/", array_keys($h)))));
unset($c);
-var_dump(raphf\stat_persistent_handles());
+$h = (array) raphf\stat_persistent_handles();
+var_dump(array_intersect_key($h, array_flip(preg_grep("/^http/", array_keys($h)))));
?>
Done
--EXPECTF--
Test
-object(stdClass)#%d (2) {
+array(2) {
["http\Client\Curl"]=>
array(0) {
}
array(0) {
}
}
-object(stdClass)#%d (2) {
+array(2) {
["http\Client\Curl"]=>
array(1) {
["php.net:80"]=>
}
}
}
-object(stdClass)#%d (2) {
+array(2) {
["http\Client\Curl"]=>
array(1) {
["php.net:80"]=>
unset($c);
-var_dump(raphf\stat_persistent_handles());
+$h = (array) raphf\stat_persistent_handles();
+var_dump(array_intersect_key($h, array_flip(preg_grep("/^http/", array_keys($h)))));
+
raphf\clean_persistent_handles("http\\Client\\Curl");
raphf\clean_persistent_handles("http\\Client\\Curl\\Request", "php.net:80");
-var_dump(raphf\stat_persistent_handles());
+$h = (array) raphf\stat_persistent_handles();
+var_dump(array_intersect_key($h, array_flip(preg_grep("/^http/", array_keys($h)))));
?>
Done
--EXPECTF--
Test
-object(stdClass)#%d (2) {
+array(2) {
["http\Client\Curl"]=>
array(1) {
["php.net:80"]=>
}
}
}
-object(stdClass)#%d (2) {
+array(2) {
["http\Client\Curl"]=>
array(0) {
}
unset($c);
-var_dump(raphf\stat_persistent_handles());
+$h = (array) raphf\stat_persistent_handles();
+var_dump(array_intersect_key($h, array_flip(preg_grep("/^http/", array_keys($h)))));
raphf\clean_persistent_handles(null, "php.net:80");
-var_dump(raphf\stat_persistent_handles());
+$h = (array) raphf\stat_persistent_handles();
+var_dump(array_intersect_key($h, array_flip(preg_grep("/^http/", array_keys($h)))));
?>
Done
--EXPECTF--
Test
-object(stdClass)#%d (2) {
+array(2) {
["http\Client\Curl"]=>
array(1) {
["php.net:80"]=>
}
}
}
-object(stdClass)#%d (2) {
+array(2) {
["http\Client\Curl"]=>
array(1) {
["php.net:80"]=>
<?php
echo "Test\n";
-var_dump(raphf\stat_persistent_handles());
+$h = (array) raphf\stat_persistent_handles();
+var_dump(array_intersect_key($h, array_flip(preg_grep("/^http/", array_keys($h)))));
$c = new http\Client("curl", "php.net:80");
$c2 = new http\Client("curl", "php.net:80");
$c2->enqueue(new http\Client\Request("GET", "http://php.net"));
} while (count($c) < 3);
-var_dump(raphf\stat_persistent_handles());
+$h = (array) raphf\stat_persistent_handles();
+var_dump(array_intersect_key($h, array_flip(preg_grep("/^http/", array_keys($h)))));
unset($c);
-var_dump(raphf\stat_persistent_handles());
+$h = (array) raphf\stat_persistent_handles();
+var_dump(array_intersect_key($h, array_flip(preg_grep("/^http/", array_keys($h)))));
raphf\clean_persistent_handles();
-var_dump(raphf\stat_persistent_handles());
+$h = (array) raphf\stat_persistent_handles();
+var_dump(array_intersect_key($h, array_flip(preg_grep("/^http/", array_keys($h)))));
?>
Done
--EXPECTF--
Test
-object(stdClass)#%d (2) {
+array(2) {
["http\Client\Curl"]=>
array(0) {
}
array(0) {
}
}
-object(stdClass)#%d (2) {
+array(2) {
["http\Client\Curl"]=>
array(1) {
["php.net:80"]=>
}
}
}
-object(stdClass)#%d (2) {
+array(2) {
["http\Client\Curl"]=>
array(1) {
["php.net:80"]=>
}
}
}
-object(stdClass)#%d (2) {
+array(2) {
["http\Client\Curl"]=>
array(1) {
["php.net:80"]=>