gethostbynamel_error.phpt [plain text]
--TEST--
Test gethostbynamel() function : error conditions
--FILE--
<?php
echo "*** Testing gethostbynamel() : error conditions ***\n";
echo "\n-- Testing gethostbynamel() function with Zero arguments --\n";
var_dump( gethostbynamel() );
echo "\n-- Testing gethostbynamel() function with more than expected no. of arguments --\n";
$hostname = 'string_val';
$extra_arg = 10;
var_dump( gethostbynamel($hostname, $extra_arg) );
echo "Done";
?>
--EXPECTF--
*** Testing gethostbynamel() : error conditions ***
-- Testing gethostbynamel() function with Zero arguments --
Warning: gethostbynamel() expects exactly 1 parameter, 0 given in %s on line %d
NULL
-- Testing gethostbynamel() function with more than expected no. of arguments --
Warning: gethostbynamel() expects exactly 1 parameter, 2 given in %s on line %d
NULL
Done