1--TEST-- 2Test setlocale() function : error condition 3--INI-- 4error_reporting=E_ALL 5--SKIPIF-- 6<?php 7if (substr(PHP_OS, 0, 3) == 'WIN') { 8 die('skip Not valid for windows'); 9} 10?> 11--FILE-- 12<?php 13echo "*** Testing setlocale() : error conditions ***\n"; 14 15echo "\n-- Testing setlocale() function with invalid locale array, 'category' = LC_ALL --\n"; 16//Invalid array of locales 17$invalid_locales = array("en_US.invalid", "en_AU.invalid", "ko_KR.invalid"); 18var_dump( setlocale(LC_ALL,$invalid_locales) ); 19 20echo "\n-- Testing setlocale() function with invalid multiple locales, 'category' = LC_ALL --\n"; 21//Invalid array of locales 22var_dump( setlocale(LC_ALL,"en_US.invalid", "en_AU.invalid", "ko_KR.invalid") ); 23 24echo "\n-- Testing setlocale() function with locale name too long, 'category' = LC_ALL --"; 25//Invalid locale - locale name too long 26var_dump(setlocale(LC_ALL,str_pad('',255,'A'))); 27 28echo "\nDone"; 29?> 30--EXPECTF-- 31*** Testing setlocale() : error conditions *** 32 33-- Testing setlocale() function with invalid locale array, 'category' = LC_ALL -- 34bool(false) 35 36-- Testing setlocale() function with invalid multiple locales, 'category' = LC_ALL -- 37bool(false) 38 39-- Testing setlocale() function with locale name too long, 'category' = LC_ALL -- 40Warning: setlocale(): Specified locale name is too long in %s on line %d 41bool(false) 42 43Done 44