Return to ip2long_error.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / network |
1.1 misho 1: --TEST-- 2: Test 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: 11: echo "*** Testing ip2long() : error conditions ***\n"; 12: 13: // Zero arguments 14: echo "\n-- Testing ip2long() function with Zero arguments --\n"; 15: var_dump( ip2long() ); 16: 17: //Test ip2long with one more than the expected number of arguments 18: echo "\n-- Testing ip2long() function with more than expected no. of arguments --\n"; 19: $ip_address = '127.0.0.1'; 20: $extra_arg = 10; 21: var_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: 30: Warning: ip2long() expects exactly 1 parameter, 0 given in %s on line %d 31: NULL 32: 33: -- Testing ip2long() function with more than expected no. of arguments -- 34: 35: Warning: ip2long() expects exactly 1 parameter, 2 given in %s on line %d 36: NULL 37: ===DONE===