1--TEST-- 2Test ip2long() function : error conditions 3--FILE-- 4<?php 5/* Prototype : int ip2long(string ip_address) 6 * Description: Converts a string containing an (IPv4) Internet Protocol dotted address into a proper address 7 * Source code: ext/standard/basic_functions.c 8 * Alias to functions: 9 */ 10 11echo "*** Testing ip2long() : error conditions ***\n"; 12 13// Zero arguments 14echo "\n-- Testing ip2long() function with Zero arguments --\n"; 15var_dump( ip2long() ); 16 17//Test ip2long with one more than the expected number of arguments 18echo "\n-- Testing ip2long() function with more than expected no. of arguments --\n"; 19$ip_address = '127.0.0.1'; 20$extra_arg = 10; 21var_dump( ip2long($ip_address, $extra_arg) ); 22 23?> 24===DONE=== 25--EXPECTF-- 26*** Testing ip2long() : error conditions *** 27 28-- Testing ip2long() function with Zero arguments -- 29 30Warning: ip2long() expects exactly 1 parameter, 0 given in %s on line %d 31NULL 32 33-- Testing ip2long() function with more than expected no. of arguments -- 34 35Warning: ip2long() expects exactly 1 parameter, 2 given in %s on line %d 36NULL 37===DONE=== 38