1--TEST--
2Test gethostbyaddr() function : error conditions
3--FILE--
4<?php
5echo "Testing gethostbyaddr : error conditions\n";
6
7echo "\n-- Testing gethostbyaddr function with invalid addresses --\n";
8
9$ip_address = 'invalid';
10var_dump( gethostbyaddr($ip_address) );
11
12$ip_address = '300.1.2.3';
13var_dump( gethostbyaddr($ip_address) );
14
15$ip_address = '256.1.2.3';
16var_dump( gethostbyaddr($ip_address) );
17
18echo "Done";
19?>
20--EXPECTREGEX--
21Testing gethostbyaddr : error conditions
22
23-- Testing gethostbyaddr function with invalid addresses --
24
25Warning: gethostbyaddr\(\): Address is not (in a.b.c.d form|a valid IPv4 or IPv6 address) in .* on line \d+
26bool\(false\)
27
28Warning: gethostbyaddr\(\): Address is not (in a.b.c.d form|a valid IPv4 or IPv6 address) in .* on line \d+
29bool\(false\)
30
31Warning: gethostbyaddr\(\): Address is not (in a.b.c.d form|a valid IPv4 or IPv6 address) in .* on line \d+
32bool\(false\)
33Done
34