|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-02-07 00:44 UTC] msaraujo@php.net
[2008-02-07 00:48 UTC] joe at digg dot com
[2008-02-07 01:12 UTC] msaraujo@php.net
[2008-07-17 23:39 UTC] jani@php.net
[2008-07-25 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 16:00:01 2025 UTC |
Description: ------------ When getaddrinfo fails fsockopen() fails to return an error string or error code. Reproduce code: --------------- <?php $code = 0; $message = ''; $fp = fsockopen('www.asdf98070978.org', 80, $code, $message); if (!is_resource($fp)) { echo 'ERROR: ' . $message . '(#' . $code . ')' . "\n"; } else { echo 'Connected!' . "\n"; fclose($fp); } ?> Expected result: ---------------- fsockopen() should return false and set an appropriate error code and error message. Actual result: -------------- It spits out a warning and doesn't include any sort of error message or string: Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /home/jstump/repository/wildcat/branches/config/foo.php on line 5 Warning: fsockopen(): unable to connect to www.asdf98070978.org:80 (Unknown error) in /home/jstump/repository/wildcat/branches/config/foo.php on line 5 ERROR: (#0)