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