Longhorn PHP 2025 - Speakers and Schedule Announced!

Voting

: max(four, zero)?
(Example: nine)

The Note You're Voting On

devers
10 years ago
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)

<< Back to user notes page

To Top