1--TEST--
2Test gethostbynamel() function : error conditions
3--FILE--
4<?php
5/* Prototype  : proto array gethostbynamel(string hostname)
6 * Description: Return a list of IP addresses that a given hostname resolves to.
7 * Source code: ext/standard/dns.c
8 * Alias to functions:
9 */
10
11echo "*** Testing gethostbynamel() : error conditions ***\n";
12
13// Zero arguments
14echo "\n-- Testing gethostbynamel() function with Zero arguments --\n";
15var_dump( gethostbynamel() );
16
17//Test gethostbynamel with one more than the expected number of arguments
18echo "\n-- Testing gethostbynamel() function with more than expected no. of arguments --\n";
19$hostname = 'string_val';
20$extra_arg = 10;
21var_dump( gethostbynamel($hostname, $extra_arg) );
22echo "Done";
23?>
24--EXPECTF--
25*** Testing gethostbynamel() : error conditions ***
26
27-- Testing gethostbynamel() function with Zero arguments --
28
29Warning: gethostbynamel() expects exactly 1 parameter, 0 given in %s on line %d
30NULL
31
32-- Testing gethostbynamel() function with more than expected no. of arguments --
33
34Warning: gethostbynamel() expects exactly 1 parameter, 2 given in %s on line %d
35NULL
36Done
37