1--TEST-- 2Test convert_cyr_string() function : error conditions 3--FILE-- 4<?php 5 6/* Prototype : string convert_cyr_string ( string $str , string $from , string $to ) 7 * Description: Convert from one Cyrillic character set to another 8 * Source code: ext/standard/string.c 9*/ 10 11$str = "hello"; 12$from = "k"; 13$to = "d"; 14$extra_arg = 10; 15 16echo "*** Testing convert_cyr_string() : error conditions ***\n"; 17 18echo "\n-- Testing convert_cyr_string() function with invalid 'from' character set --\n"; 19var_dump(bin2hex( convert_cyr_string($str, "?", $to) )); 20 21echo "\n-- Testing convert_cyr_string() function with invalid 'to' character set --\n"; 22var_dump(bin2hex( convert_cyr_string($str, $from, "?")) ); 23 24echo "\n-- Testing convert_cyr_string() function with invalid 'from' and 'to' character set --\n"; 25var_dump(bin2hex( convert_cyr_string($str, ">", "?")) ); 26 27?> 28===DONE=== 29--EXPECTF-- 30*** Testing convert_cyr_string() : error conditions *** 31 32-- Testing convert_cyr_string() function with invalid 'from' character set -- 33 34Deprecated: Function convert_cyr_string() is deprecated in %s on line %d 35 36Warning: convert_cyr_string(): Unknown source charset: ? in %s on line %d 37string(10) "68656c6c6f" 38 39-- Testing convert_cyr_string() function with invalid 'to' character set -- 40 41Deprecated: Function convert_cyr_string() is deprecated in %s on line %d 42 43Warning: convert_cyr_string(): Unknown destination charset: ? in %s on line %d 44string(10) "68656c6c6f" 45 46-- Testing convert_cyr_string() function with invalid 'from' and 'to' character set -- 47 48Deprecated: Function convert_cyr_string() is deprecated in %s on line %d 49 50Warning: convert_cyr_string(): Unknown source charset: > in %s on line %d 51 52Warning: convert_cyr_string(): Unknown destination charset: ? in %s on line %d 53string(10) "68656c6c6f" 54===DONE=== 55