This function says "Returns the IPv4 address or a string containing the unmodified hostname on failure.
This isn't entirely true, any hostname with a null byte in it will only return the characters BEFORE the null byte.
<?php
$hostname = "foo\0bar";
var_dump($hostname );
var_dump(gethostbyname($hostname ));
?>
Results:
string 'foo�bar' (length=7)
string 'foo' (length=3)