Doc #51906 [Com]: document that dns_get_record returns empty string on error
| From: | ksenzee at gmail dot com | Date: | Thu, 27 May 2010 00:31:05 +0000 |
| Subject: | Doc #51906 [Com]: document that dns_get_record returns empty string on error | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-4449@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51906&edit=1
ID: 51906
Comment by: ksenzee at gmail dot com
Reported by: ksenzee at gmail dot com
Summary: document that dns_get_record returns empty string on error
Status: Feedback
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
New Comment:
Hm. I misread my log, so I was too hasty in my original report. What I
should have said is that on *error*, dns_get_record returns FALSE and
triggers a warning:
Warning: dns_get_record() [function.dns-get-record]: res_nsend() failed
in ...
I can't provide a test script that reliably makes dns_get_record() error
out. I'm assuming it depends on network conditions and the like.
Previous Comments:
------------------------------------------------------------------------
[2010-05-27 01:52:12] degeberg@php.net
I can't reproduce that. Could you give a script that results in that
behavior along with the version of PHP you're using?
daniel@daniel-laptop:~$ cat test.php
<?php
var_dump(dns_get_record('fooaskljdalskdj.com'));
?>
daniel@daniel-laptop:~$ php -nv; php -n test.php
PHP 5.3.3-dev (cli) (built: May 23 2010 12:30:56)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
array(0) {
}
daniel@daniel-laptop:~$ src/php-5.2.13/sapi/cli/php test.php
array(0) {
}
------------------------------------------------------------------------
[2010-05-25 18:18:50] ksenzee at gmail dot com
Description:
------------
The documentation for dns_get_record says the return value is an array
of associative arrays. It should also point out that if there is no DNS
record for the domain being queried, it returns an empty string.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51906&edit=1