|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-09-01 17:20 UTC] pollita@php.net
[2013-08-20 15:47 UTC] daverandom@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 17:00:01 2025 UTC |
Description: ------------ The bug is in the function gethostbynamel. When a domain name is passed to it as an argument then it should return the associated ip addresses of this domain in an array, this is working properly in version 4.3.1. But in version 4.3.2 the bugs are as under. 1)It is returning an ip for a domain name which is not valid, where as it should have returned false in case of non valid domain name. 2)It is only returning a single ip associated with the domain, not all the ip addresses. Reproduce code: --------------- #CODE FOR CASE 1 if($hosts = gethostbynamel('com')){ print_r($hosts); }else{ print "Invalid domain"; } #CODE FOR CASE 2 if($hosts = gethostbynamel('yahoo.com')){ print_r($hosts); }else{ print "Invalid domain"; Expected result: ---------------- #EXPECTED RESULT FOR CASE 1 Invalid domain #EXPECTED RESULT FOR CASE 2 Array ( [0] => 216.109.118.76 [1] => 216.109.118.77 [2] => 216.109.118.78 [3] => 216.109.118.65 [4] => 216.109.118.69 [5] => 216.109.118.71 [6] => 216.109.118.72 [7] => 216.109.118.74 ) Actual result: -------------- #ACTUAL RESULT FOR CASE 1 Array ( [0] => 206.16.0.134 ) #ACTUAL RESULT FOR CASE 2 Array ( [0] => 66.218.71.198 )