1--TEST-- 2Test bin2hex() function : error conditions 3--FILE-- 4<?php 5 6/* Prototype : string bin2hex ( string $str ) 7 * Description: Convert binary data into hexadecimal representation 8 * Source code: ext/standard/string.c 9*/ 10 11echo "*** Testing bin2hex() : error conditions ***\n"; 12 13echo "\n-- Testing bin2hex() function with no arguments --\n"; 14var_dump( bin2hex() ); 15 16echo "\n-- Testing bin2hex() function with more than expected no. of arguments --\n"; 17$extra_arg = 10; 18var_dump( bin2hex("Hello World", $extra_arg) ); 19 20?> 21===DONE=== 22--EXPECTF-- 23*** Testing bin2hex() : error conditions *** 24 25-- Testing bin2hex() function with no arguments -- 26 27Warning: bin2hex() expects exactly 1 parameter, 0 given in %s on line %d 28NULL 29 30-- Testing bin2hex() function with more than expected no. of arguments -- 31 32Warning: bin2hex() expects exactly 1 parameter, 2 given in %s on line %d 33NULL 34===DONE=== 35