1--TEST-- 2str_ireplace() tests 3--FILE-- 4<?php 5 6var_dump(str_ireplace("", "", "")); 7 8var_dump(str_ireplace("tt", "a", "ttttTttttttttTT")); 9var_dump(str_ireplace("tt", "a", "ttttTttttttttTT", $count)); 10var_dump($count); 11 12var_dump(str_ireplace("tt", "aa", "ttttTttttttttTT")); 13var_dump(str_ireplace("tt", "aa", "ttttTttttttttTT", $count)); 14var_dump($count); 15 16var_dump(str_ireplace("tt", "aaa", "ttttTttttttttTT")); 17var_dump(str_ireplace("tt", "aaa", "ttttTttttttttTT", $count)); 18var_dump($count); 19 20var_dump(str_ireplace("tt", "aaa", "ttttTttttttttTT")); 21var_dump(str_ireplace("tt", "aaa", "ttttTttttttttTT", $count)); 22var_dump($count); 23 24var_dump(str_ireplace(array("tt", "tt"), "aaa", "ttttTttttttttTT")); 25var_dump(str_ireplace(array("tt", "tt"), array("aaa"), "ttttTttttttttTT")); 26var_dump(str_ireplace(array("tt", "y"), array("aaa", "bbb"), "ttttTttttttttTT")); 27 28var_dump(str_ireplace(array("tt", "tt"), "aaa", "ttttTttttttttTT")); 29var_dump(str_ireplace(array("tt", "tt"), array("aaa"), "ttttTttttttttTT")); 30var_dump(str_ireplace(array("tt", "y"), array("aaa", "bbb"), "ttttTttttttttTT")); 31 32var_dump(str_ireplace(array("tt", "y"), array("aaa", "bbb"), array("ttttTttttttttTT", "aayyaayasdayYahsdYYY"))); 33var_dump(str_ireplace(array("tt", "y"), array("aaa", "bbb"), array("key"=>"ttttTttttttttTT", "test"=>"aayyaayasdayYahsdYYY"))); 34var_dump(str_ireplace(array("t"=>"tt", "y"=>"y"), array("a"=>"aaa", "b"=>"bbb"), array("key"=>"ttttTttttttttTT", "test"=>"aayyaayasdayYahsdYYY"))); 35 36/* separate testcase for str_ireplace() off-by-one */ 37 38$Data = "Change tracking and management software designed to watch 39 for abnormal system behavior.\nSuggest features, report bugs, or ask 40 questions here."; 41var_dump($Data = str_ireplace("\r\n", "<br>", $Data)); 42var_dump($Data = str_ireplace("\n", "<br>", $Data)); 43 44 45echo "Done\n"; 46?> 47--EXPECT-- 48string(0) "" 49string(8) "aaaaaaaT" 50string(8) "aaaaaaaT" 51int(7) 52string(15) "aaaaaaaaaaaaaaT" 53string(15) "aaaaaaaaaaaaaaT" 54int(7) 55string(22) "aaaaaaaaaaaaaaaaaaaaaT" 56string(22) "aaaaaaaaaaaaaaaaaaaaaT" 57int(7) 58string(22) "aaaaaaaaaaaaaaaaaaaaaT" 59string(22) "aaaaaaaaaaaaaaaaaaaaaT" 60int(7) 61string(22) "aaaaaaaaaaaaaaaaaaaaaT" 62string(22) "aaaaaaaaaaaaaaaaaaaaaT" 63string(22) "aaaaaaaaaaaaaaaaaaaaaT" 64string(22) "aaaaaaaaaaaaaaaaaaaaaT" 65string(22) "aaaaaaaaaaaaaaaaaaaaaT" 66string(22) "aaaaaaaaaaaaaaaaaaaaaT" 67array(2) { 68 [0]=> 69 string(22) "aaaaaaaaaaaaaaaaaaaaaT" 70 [1]=> 71 string(36) "aabbbbbbaabbbasdabbbbbbahsdbbbbbbbbb" 72} 73array(2) { 74 ["key"]=> 75 string(22) "aaaaaaaaaaaaaaaaaaaaaT" 76 ["test"]=> 77 string(36) "aabbbbbbaabbbasdabbbbbbahsdbbbbbbbbb" 78} 79array(2) { 80 ["key"]=> 81 string(22) "aaaaaaaaaaaaaaaaaaaaaT" 82 ["test"]=> 83 string(36) "aabbbbbbaabbbasdabbbbbbahsdbbbbbbbbb" 84} 85string(149) "Change tracking and management software designed to watch 86 for abnormal system behavior. 87Suggest features, report bugs, or ask 88 questions here." 89string(158) "Change tracking and management software designed to watch<br> for abnormal system behavior.<br>Suggest features, report bugs, or ask<br> questions here." 90Done 91