mirror of
https://github.com/danog/ext-uv.git
synced 2024-11-30 04:29:01 +01:00
35 lines
644 B
Plaintext
35 lines
644 B
Plaintext
|
--TEST--
|
||
|
Check for ares_gethostbyname
|
||
|
--FILE--
|
||
|
<?php
|
||
|
$uv = uv_ares_init_options(uv_default_loop(), array(
|
||
|
"servers" => array(
|
||
|
"8.8.8.8"
|
||
|
),
|
||
|
"port"=>53
|
||
|
),null);
|
||
|
|
||
|
ares_gethostbyname($uv,"php.net",AF_INET, function($name, $addr){
|
||
|
echo $name . PHP_EOL;
|
||
|
if (is_array($addr)) {
|
||
|
echo "OK";
|
||
|
} else {
|
||
|
echo "FAILED";
|
||
|
}
|
||
|
});
|
||
|
|
||
|
ares_gethostbyname($uv,"php.net",AF_INET, function($name, $addr){
|
||
|
echo $name . PHP_EOL;
|
||
|
if (is_array($addr)) {
|
||
|
echo "OK" . PHP_EOL;
|
||
|
} else {
|
||
|
echo "FAILED: 2nd parameter does not array" . PHP_EOL;
|
||
|
}
|
||
|
});
|
||
|
|
||
|
uv_run();
|
||
|
--EXPECT--
|
||
|
php.net
|
||
|
OK
|
||
|
php.net
|
||
|
OK
|