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