1--TEST-- 2Test mb_strtolower() function : error conditions - pass incorrect number of arguments 3--SKIPIF-- 4<?php 5extension_loaded('mbstring') or die('skip'); 6function_exists('mb_strtolower') or die("skip mb_strtolower() is not available in this build"); 7?> 8--FILE-- 9<?php 10/* Prototype : string mb_strtolower(string $sourcestring [, string $encoding]) 11 * Description: Returns a lowercased version of $sourcestring 12 * Source code: ext/mbstring/mbstring.c 13 */ 14 15/* 16 * Pass an incorrect number of arguments to mb_strtolower() to test behaviour 17 */ 18 19echo "*** Testing mb_strtolower() : error conditions***\n"; 20 21//Test mb_strtolower with one more than the expected number of arguments 22echo "\n-- Testing mb_strtolower() function with more than expected no. of arguments --\n"; 23$sourcestring = 'string_value'; 24$encoding = 'UTF-8'; 25$extra_arg = 10; 26var_dump( mb_strtolower($sourcestring, $encoding, $extra_arg) ); 27 28//Test mb_strtolower with zero arguments 29echo "\n-- Testing mb_strtolower() function with zero arguments --\n"; 30var_dump( mb_strtolower() ); 31 32echo "Done"; 33?> 34--EXPECTF-- 35*** Testing mb_strtolower() : error conditions*** 36 37-- Testing mb_strtolower() function with more than expected no. of arguments -- 38 39Warning: mb_strtolower() expects at most 2 parameters, 3 given in %s on line %d 40NULL 41 42-- Testing mb_strtolower() function with zero arguments -- 43 44Warning: mb_strtolower() expects at least 1 parameter, 0 given in %s on line %d 45NULL 46Done 47