strcasecmp.phpt 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  1. --TEST--
  2. strcasecmp() function
  3. --INI--
  4. precision = 12
  5. --FILE--
  6. <?php
  7. /* Compares two strings in case-insensitive manner */
  8. echo "#### Basic and Possible operations ####";
  9. /* creating an array of strings to be compared */
  10. $arrays = array(
  11. array("a", 'A', chr(128), chr(255), chr(256)),
  12. array("acc", "Acc", 'aC', "acCc", 'acd', "?acc", 'Acc!', "$!acc", ";acc"),
  13. array("1", "0", 0, "-1", -1, NULL, null, "", TRUE, true, FALSE, "string"),
  14. array(10.5, 1.5, 9.5, 11.5, 100.5, 10.5E1, -10.5, 10, 0.5)
  15. );
  16. /* loop through to go each and every element in an array
  17. and comparing the elements with one and other */
  18. foreach($arrays as $str1_arr){
  19. echo "\n*** comparing the strings in an \n";
  20. print_r($str1_arr);
  21. for ($i=0; $i<count($str1_arr); $i++){
  22. echo "\nIteration $i\n";
  23. for($j=0; $j<count($str1_arr); $j++){
  24. echo "- strcasecmp of '$str1_arr[$i]' and '$str1_arr[$j]' is => ";
  25. var_dump(strcasecmp($str1_arr[$i], $str1_arr[$j]));
  26. }
  27. }
  28. }
  29. echo "\n#### Testing Miscelleneous inputs ####\n";
  30. echo "--- Testing objects ---\n";
  31. /* we get "Catchable fatal error: saying Object of class could not be converted
  32. to string" by default when an object is passed instead of string.
  33. The error can be avoided by choosing the __toString magix method as follows: */
  34. class string1 {
  35. function __toString() {
  36. return "Hello, world";
  37. }
  38. }
  39. $obj_string1 = new string1;
  40. class string2 {
  41. function __toString() {
  42. return "hello, world\0";
  43. }
  44. }
  45. $obj_string2 = new string2;
  46. var_dump(strcasecmp("$obj_string1", "$obj_string2"));
  47. echo "\n--- Testing arrays ---\n";
  48. $str_arr = array("hello", "?world", "!$%**()%**[][[[&@#~!");
  49. var_dump(strcasecmp("hello?world,!$%**()%**[][[[&@#~!", $str_arr));
  50. var_dump(strcasecmp("hello?world,!$%**()%**[][[[&@#~!", "$str_arr[1]"));
  51. var_dump(strcasecmp("hello?world,!$%**()%**[][[[&@#~!", "$str_arr[2]"));
  52. echo "\n--- Testing Resources ---\n";
  53. $filename1 = "dummy.txt";
  54. $filename2 = "dummy1.txt";
  55. $file1 = fopen($filename1, "w"); // creating new file
  56. $file2 = fopen($filename2, "w"); // creating new file
  57. /* getting resource type for file handle */
  58. $string1 = get_resource_type($file1);
  59. $string2 = get_resource_type($file2);
  60. $string3 = (int)get_resource_type($file2);
  61. /* string1 and string2 of same "stream" type */
  62. var_dump(strcasecmp($string1, $string2)); // int(0)
  63. /* string1 is of "stream" type & string3 is of "int" type */
  64. var_dump(strcasecmp($string1, $string3)); // int(1)
  65. fclose($file1); // closing the file "dummy.txt"
  66. fclose($file2); // closing the file "dummy1.txt"
  67. unlink("$filename1"); // deletes "dummy.txt"
  68. unlink("$filename2"); // deletes "dummy1.txt"
  69. echo "\n--- Testing a longer and heredoc string ---\n";
  70. $string = <<<EOD
  71. abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789
  72. abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789
  73. abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789
  74. abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789
  75. abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789
  76. abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789
  77. abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789
  78. @#$%^&**&^%$#@!~:())))((((&&&**%$###@@@!!!~~~~@###$%^&*
  79. abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789
  80. EOD;
  81. var_dump(strcasecmp($string, $string));
  82. var_dump(strcasecmp($string, "xyz0123456789"));
  83. var_dump(strcasecmp($string, "&&&"));
  84. echo "\n--- Testing a heredoc null string ---\n";
  85. $str = <<<EOD
  86. EOD;
  87. var_dump(strcasecmp($str, "\0"));
  88. var_dump(strcasecmp($str, NULL));
  89. var_dump(strcasecmp($str, "0"));
  90. echo "\n--- Testing simple and complex syntax strings ---\n";
  91. $str = 'world';
  92. /* Simple syntax */
  93. var_dump(strcasecmp("Hello, world", "$str"));
  94. var_dump(strcasecmp("Hello, world'S", "$str'S"));
  95. var_dump(strcasecmp("Hello, worldS", "$strS"));
  96. /* String with curly braces, complex syntax */
  97. var_dump(strcasecmp("Hello, worldS", "${str}S"));
  98. var_dump(strcasecmp("Hello, worldS", "{$str}S"));
  99. echo "\n--- Testing binary safe and binary chars ---\n";
  100. var_dump(strcasecmp("Hello\0world", "Hello"));
  101. var_dump(strcasecmp("Hello\0world", "Helloworld"));
  102. var_dump(strcasecmp("\x0", "\0"));
  103. var_dump(strcasecmp("\000", "\0"));
  104. var_dump(strcasecmp("\x00", ""));
  105. var_dump(strcasecmp("\x00", NULL));
  106. var_dump(strcasecmp("\000", NULL));
  107. echo "\n--- Comparing long float values ---\n";
  108. /* Here two different outputs, which depends on the rounding value
  109. before converting to string. Here Precision = 12 */
  110. var_dump(strcasecmp(10.55555555555555555555555555, 10.5555555556)); // int(0)
  111. var_dump(strcasecmp(10.55555555555555555555555555, 10.555555556)); // int(-1)
  112. var_dump(strcasecmp(10.55555555595555555555555555, 10.555555556)); // int(0)
  113. echo "\n#### checking error conditions ####";
  114. strcasecmp();
  115. strcasecmp("");
  116. strcasecmp("HI");
  117. strcasecmp("Hi", "Hello", "World");
  118. echo "Done\n";
  119. ?>
  120. --EXPECTF--
  121. #### Basic and Possible operations ####
  122. *** comparing the strings in an
  123. Array
  124. (
  125. [0] => a
  126. [1] => A
  127. [2] => €
  128. [3] => ÿ
  129. [4] => �
  130. )
  131. Iteration 0
  132. - strcasecmp of 'a' and 'a' is => int(0)
  133. - strcasecmp of 'a' and 'A' is => int(0)
  134. - strcasecmp of 'a' and '€' is => int(-%d)
  135. - strcasecmp of 'a' and 'ÿ' is => int(-%d)
  136. - strcasecmp of 'a' and '�' is => int(%d)
  137. Iteration 1
  138. - strcasecmp of 'A' and 'a' is => int(0)
  139. - strcasecmp of 'A' and 'A' is => int(0)
  140. - strcasecmp of 'A' and '€' is => int(-%d)
  141. - strcasecmp of 'A' and 'ÿ' is => int(-%d)
  142. - strcasecmp of 'A' and '�' is => int(%d)
  143. Iteration 2
  144. - strcasecmp of '€' and 'a' is => int(%d)
  145. - strcasecmp of '€' and 'A' is => int(%d)
  146. - strcasecmp of '€' and '€' is => int(0)
  147. - strcasecmp of '€' and 'ÿ' is => int(-%d)
  148. - strcasecmp of '€' and '�' is => int(%d)
  149. Iteration 3
  150. - strcasecmp of 'ÿ' and 'a' is => int(%d)
  151. - strcasecmp of 'ÿ' and 'A' is => int(%d)
  152. - strcasecmp of 'ÿ' and '€' is => int(%d)
  153. - strcasecmp of 'ÿ' and 'ÿ' is => int(0)
  154. - strcasecmp of 'ÿ' and '�' is => int(%d)
  155. Iteration 4
  156. - strcasecmp of '�' and 'a' is => int(-%d)
  157. - strcasecmp of '�' and 'A' is => int(-%d)
  158. - strcasecmp of '�' and '€' is => int(-%d)
  159. - strcasecmp of '�' and 'ÿ' is => int(-%d)
  160. - strcasecmp of '�' and '�' is => int(0)
  161. *** comparing the strings in an
  162. Array
  163. (
  164. [0] => acc
  165. [1] => Acc
  166. [2] => aC
  167. [3] => acCc
  168. [4] => acd
  169. [5] => ?acc
  170. [6] => Acc!
  171. [7] => $!acc
  172. [8] => ;acc
  173. )
  174. Iteration 0
  175. - strcasecmp of 'acc' and 'acc' is => int(0)
  176. - strcasecmp of 'acc' and 'Acc' is => int(0)
  177. - strcasecmp of 'acc' and 'aC' is => int(%d)
  178. - strcasecmp of 'acc' and 'acCc' is => int(-%d)
  179. - strcasecmp of 'acc' and 'acd' is => int(-%d)
  180. - strcasecmp of 'acc' and '?acc' is => int(%d)
  181. - strcasecmp of 'acc' and 'Acc!' is => int(-%d)
  182. - strcasecmp of 'acc' and '$!acc' is => int(%d)
  183. - strcasecmp of 'acc' and ';acc' is => int(%d)
  184. Iteration 1
  185. - strcasecmp of 'Acc' and 'acc' is => int(0)
  186. - strcasecmp of 'Acc' and 'Acc' is => int(0)
  187. - strcasecmp of 'Acc' and 'aC' is => int(%d)
  188. - strcasecmp of 'Acc' and 'acCc' is => int(-%d)
  189. - strcasecmp of 'Acc' and 'acd' is => int(-%d)
  190. - strcasecmp of 'Acc' and '?acc' is => int(%d)
  191. - strcasecmp of 'Acc' and 'Acc!' is => int(-%d)
  192. - strcasecmp of 'Acc' and '$!acc' is => int(%d)
  193. - strcasecmp of 'Acc' and ';acc' is => int(%d)
  194. Iteration 2
  195. - strcasecmp of 'aC' and 'acc' is => int(-%d)
  196. - strcasecmp of 'aC' and 'Acc' is => int(-%d)
  197. - strcasecmp of 'aC' and 'aC' is => int(0)
  198. - strcasecmp of 'aC' and 'acCc' is => int(-%d)
  199. - strcasecmp of 'aC' and 'acd' is => int(-%d)
  200. - strcasecmp of 'aC' and '?acc' is => int(%d)
  201. - strcasecmp of 'aC' and 'Acc!' is => int(-%d)
  202. - strcasecmp of 'aC' and '$!acc' is => int(%d)
  203. - strcasecmp of 'aC' and ';acc' is => int(%d)
  204. Iteration 3
  205. - strcasecmp of 'acCc' and 'acc' is => int(%d)
  206. - strcasecmp of 'acCc' and 'Acc' is => int(%d)
  207. - strcasecmp of 'acCc' and 'aC' is => int(%d)
  208. - strcasecmp of 'acCc' and 'acCc' is => int(0)
  209. - strcasecmp of 'acCc' and 'acd' is => int(-%d)
  210. - strcasecmp of 'acCc' and '?acc' is => int(%d)
  211. - strcasecmp of 'acCc' and 'Acc!' is => int(%d)
  212. - strcasecmp of 'acCc' and '$!acc' is => int(%d)
  213. - strcasecmp of 'acCc' and ';acc' is => int(%d)
  214. Iteration 4
  215. - strcasecmp of 'acd' and 'acc' is => int(%d)
  216. - strcasecmp of 'acd' and 'Acc' is => int(%d)
  217. - strcasecmp of 'acd' and 'aC' is => int(%d)
  218. - strcasecmp of 'acd' and 'acCc' is => int(%d)
  219. - strcasecmp of 'acd' and 'acd' is => int(0)
  220. - strcasecmp of 'acd' and '?acc' is => int(%d)
  221. - strcasecmp of 'acd' and 'Acc!' is => int(%d)
  222. - strcasecmp of 'acd' and '$!acc' is => int(%d)
  223. - strcasecmp of 'acd' and ';acc' is => int(%d)
  224. Iteration 5
  225. - strcasecmp of '?acc' and 'acc' is => int(-%d)
  226. - strcasecmp of '?acc' and 'Acc' is => int(-%d)
  227. - strcasecmp of '?acc' and 'aC' is => int(-%d)
  228. - strcasecmp of '?acc' and 'acCc' is => int(-%d)
  229. - strcasecmp of '?acc' and 'acd' is => int(-%d)
  230. - strcasecmp of '?acc' and '?acc' is => int(0)
  231. - strcasecmp of '?acc' and 'Acc!' is => int(-%d)
  232. - strcasecmp of '?acc' and '$!acc' is => int(%d)
  233. - strcasecmp of '?acc' and ';acc' is => int(%d)
  234. Iteration 6
  235. - strcasecmp of 'Acc!' and 'acc' is => int(%d)
  236. - strcasecmp of 'Acc!' and 'Acc' is => int(%d)
  237. - strcasecmp of 'Acc!' and 'aC' is => int(%d)
  238. - strcasecmp of 'Acc!' and 'acCc' is => int(-%d)
  239. - strcasecmp of 'Acc!' and 'acd' is => int(-%d)
  240. - strcasecmp of 'Acc!' and '?acc' is => int(%d)
  241. - strcasecmp of 'Acc!' and 'Acc!' is => int(0)
  242. - strcasecmp of 'Acc!' and '$!acc' is => int(%d)
  243. - strcasecmp of 'Acc!' and ';acc' is => int(%d)
  244. Iteration 7
  245. - strcasecmp of '$!acc' and 'acc' is => int(-%d)
  246. - strcasecmp of '$!acc' and 'Acc' is => int(-%d)
  247. - strcasecmp of '$!acc' and 'aC' is => int(-%d)
  248. - strcasecmp of '$!acc' and 'acCc' is => int(-%d)
  249. - strcasecmp of '$!acc' and 'acd' is => int(-%d)
  250. - strcasecmp of '$!acc' and '?acc' is => int(-%d)
  251. - strcasecmp of '$!acc' and 'Acc!' is => int(-%d)
  252. - strcasecmp of '$!acc' and '$!acc' is => int(0)
  253. - strcasecmp of '$!acc' and ';acc' is => int(-%d)
  254. Iteration 8
  255. - strcasecmp of ';acc' and 'acc' is => int(-%d)
  256. - strcasecmp of ';acc' and 'Acc' is => int(-%d)
  257. - strcasecmp of ';acc' and 'aC' is => int(-%d)
  258. - strcasecmp of ';acc' and 'acCc' is => int(-%d)
  259. - strcasecmp of ';acc' and 'acd' is => int(-%d)
  260. - strcasecmp of ';acc' and '?acc' is => int(-%d)
  261. - strcasecmp of ';acc' and 'Acc!' is => int(-%d)
  262. - strcasecmp of ';acc' and '$!acc' is => int(%d)
  263. - strcasecmp of ';acc' and ';acc' is => int(0)
  264. *** comparing the strings in an
  265. Array
  266. (
  267. [0] => 1
  268. [1] => 0
  269. [2] => 0
  270. [3] => -1
  271. [4] => -1
  272. [5] =>
  273. [6] =>
  274. [7] =>
  275. [8] => 1
  276. [9] => 1
  277. [10] =>
  278. [11] => string
  279. )
  280. Iteration 0
  281. - strcasecmp of '1' and '1' is => int(0)
  282. - strcasecmp of '1' and '0' is => int(%d)
  283. - strcasecmp of '1' and '0' is => int(%d)
  284. - strcasecmp of '1' and '-1' is => int(%d)
  285. - strcasecmp of '1' and '-1' is => int(%d)
  286. - strcasecmp of '1' and '' is => int(%d)
  287. - strcasecmp of '1' and '' is => int(%d)
  288. - strcasecmp of '1' and '' is => int(%d)
  289. - strcasecmp of '1' and '1' is => int(0)
  290. - strcasecmp of '1' and '1' is => int(0)
  291. - strcasecmp of '1' and '' is => int(%d)
  292. - strcasecmp of '1' and 'string' is => int(-%d)
  293. Iteration 1
  294. - strcasecmp of '0' and '1' is => int(-%d)
  295. - strcasecmp of '0' and '0' is => int(0)
  296. - strcasecmp of '0' and '0' is => int(0)
  297. - strcasecmp of '0' and '-1' is => int(%d)
  298. - strcasecmp of '0' and '-1' is => int(%d)
  299. - strcasecmp of '0' and '' is => int(%d)
  300. - strcasecmp of '0' and '' is => int(%d)
  301. - strcasecmp of '0' and '' is => int(%d)
  302. - strcasecmp of '0' and '1' is => int(-%d)
  303. - strcasecmp of '0' and '1' is => int(-%d)
  304. - strcasecmp of '0' and '' is => int(%d)
  305. - strcasecmp of '0' and 'string' is => int(-%d)
  306. Iteration 2
  307. - strcasecmp of '0' and '1' is => int(-%d)
  308. - strcasecmp of '0' and '0' is => int(0)
  309. - strcasecmp of '0' and '0' is => int(0)
  310. - strcasecmp of '0' and '-1' is => int(%d)
  311. - strcasecmp of '0' and '-1' is => int(%d)
  312. - strcasecmp of '0' and '' is => int(%d)
  313. - strcasecmp of '0' and '' is => int(%d)
  314. - strcasecmp of '0' and '' is => int(%d)
  315. - strcasecmp of '0' and '1' is => int(-%d)
  316. - strcasecmp of '0' and '1' is => int(-%d)
  317. - strcasecmp of '0' and '' is => int(%d)
  318. - strcasecmp of '0' and 'string' is => int(-%d)
  319. Iteration 3
  320. - strcasecmp of '-1' and '1' is => int(-%d)
  321. - strcasecmp of '-1' and '0' is => int(-%d)
  322. - strcasecmp of '-1' and '0' is => int(-%d)
  323. - strcasecmp of '-1' and '-1' is => int(0)
  324. - strcasecmp of '-1' and '-1' is => int(0)
  325. - strcasecmp of '-1' and '' is => int(%d)
  326. - strcasecmp of '-1' and '' is => int(%d)
  327. - strcasecmp of '-1' and '' is => int(%d)
  328. - strcasecmp of '-1' and '1' is => int(-%d)
  329. - strcasecmp of '-1' and '1' is => int(-%d)
  330. - strcasecmp of '-1' and '' is => int(%d)
  331. - strcasecmp of '-1' and 'string' is => int(-%d)
  332. Iteration 4
  333. - strcasecmp of '-1' and '1' is => int(-%d)
  334. - strcasecmp of '-1' and '0' is => int(-%d)
  335. - strcasecmp of '-1' and '0' is => int(-%d)
  336. - strcasecmp of '-1' and '-1' is => int(0)
  337. - strcasecmp of '-1' and '-1' is => int(0)
  338. - strcasecmp of '-1' and '' is => int(%d)
  339. - strcasecmp of '-1' and '' is => int(%d)
  340. - strcasecmp of '-1' and '' is => int(%d)
  341. - strcasecmp of '-1' and '1' is => int(-%d)
  342. - strcasecmp of '-1' and '1' is => int(-%d)
  343. - strcasecmp of '-1' and '' is => int(%d)
  344. - strcasecmp of '-1' and 'string' is => int(-%d)
  345. Iteration 5
  346. - strcasecmp of '' and '1' is => int(-%d)
  347. - strcasecmp of '' and '0' is => int(-%d)
  348. - strcasecmp of '' and '0' is => int(-%d)
  349. - strcasecmp of '' and '-1' is => int(-%d)
  350. - strcasecmp of '' and '-1' is => int(-%d)
  351. - strcasecmp of '' and '' is => int(0)
  352. - strcasecmp of '' and '' is => int(0)
  353. - strcasecmp of '' and '' is => int(0)
  354. - strcasecmp of '' and '1' is => int(-%d)
  355. - strcasecmp of '' and '1' is => int(-%d)
  356. - strcasecmp of '' and '' is => int(0)
  357. - strcasecmp of '' and 'string' is => int(-%d)
  358. Iteration 6
  359. - strcasecmp of '' and '1' is => int(-%d)
  360. - strcasecmp of '' and '0' is => int(-%d)
  361. - strcasecmp of '' and '0' is => int(-%d)
  362. - strcasecmp of '' and '-1' is => int(-%d)
  363. - strcasecmp of '' and '-1' is => int(-%d)
  364. - strcasecmp of '' and '' is => int(0)
  365. - strcasecmp of '' and '' is => int(0)
  366. - strcasecmp of '' and '' is => int(0)
  367. - strcasecmp of '' and '1' is => int(-%d)
  368. - strcasecmp of '' and '1' is => int(-%d)
  369. - strcasecmp of '' and '' is => int(0)
  370. - strcasecmp of '' and 'string' is => int(-%d)
  371. Iteration 7
  372. - strcasecmp of '' and '1' is => int(-%d)
  373. - strcasecmp of '' and '0' is => int(-%d)
  374. - strcasecmp of '' and '0' is => int(-%d)
  375. - strcasecmp of '' and '-1' is => int(-%d)
  376. - strcasecmp of '' and '-1' is => int(-%d)
  377. - strcasecmp of '' and '' is => int(0)
  378. - strcasecmp of '' and '' is => int(0)
  379. - strcasecmp of '' and '' is => int(0)
  380. - strcasecmp of '' and '1' is => int(-%d)
  381. - strcasecmp of '' and '1' is => int(-%d)
  382. - strcasecmp of '' and '' is => int(0)
  383. - strcasecmp of '' and 'string' is => int(-%d)
  384. Iteration 8
  385. - strcasecmp of '1' and '1' is => int(0)
  386. - strcasecmp of '1' and '0' is => int(%d)
  387. - strcasecmp of '1' and '0' is => int(%d)
  388. - strcasecmp of '1' and '-1' is => int(%d)
  389. - strcasecmp of '1' and '-1' is => int(%d)
  390. - strcasecmp of '1' and '' is => int(%d)
  391. - strcasecmp of '1' and '' is => int(%d)
  392. - strcasecmp of '1' and '' is => int(%d)
  393. - strcasecmp of '1' and '1' is => int(0)
  394. - strcasecmp of '1' and '1' is => int(0)
  395. - strcasecmp of '1' and '' is => int(%d)
  396. - strcasecmp of '1' and 'string' is => int(-%d)
  397. Iteration 9
  398. - strcasecmp of '1' and '1' is => int(0)
  399. - strcasecmp of '1' and '0' is => int(%d)
  400. - strcasecmp of '1' and '0' is => int(%d)
  401. - strcasecmp of '1' and '-1' is => int(%d)
  402. - strcasecmp of '1' and '-1' is => int(%d)
  403. - strcasecmp of '1' and '' is => int(%d)
  404. - strcasecmp of '1' and '' is => int(%d)
  405. - strcasecmp of '1' and '' is => int(%d)
  406. - strcasecmp of '1' and '1' is => int(0)
  407. - strcasecmp of '1' and '1' is => int(0)
  408. - strcasecmp of '1' and '' is => int(%d)
  409. - strcasecmp of '1' and 'string' is => int(-%d)
  410. Iteration 10
  411. - strcasecmp of '' and '1' is => int(-%d)
  412. - strcasecmp of '' and '0' is => int(-%d)
  413. - strcasecmp of '' and '0' is => int(-%d)
  414. - strcasecmp of '' and '-1' is => int(-%d)
  415. - strcasecmp of '' and '-1' is => int(-%d)
  416. - strcasecmp of '' and '' is => int(0)
  417. - strcasecmp of '' and '' is => int(0)
  418. - strcasecmp of '' and '' is => int(0)
  419. - strcasecmp of '' and '1' is => int(-%d)
  420. - strcasecmp of '' and '1' is => int(-%d)
  421. - strcasecmp of '' and '' is => int(0)
  422. - strcasecmp of '' and 'string' is => int(-%d)
  423. Iteration 11
  424. - strcasecmp of 'string' and '1' is => int(%d)
  425. - strcasecmp of 'string' and '0' is => int(%d)
  426. - strcasecmp of 'string' and '0' is => int(%d)
  427. - strcasecmp of 'string' and '-1' is => int(%d)
  428. - strcasecmp of 'string' and '-1' is => int(%d)
  429. - strcasecmp of 'string' and '' is => int(%d)
  430. - strcasecmp of 'string' and '' is => int(%d)
  431. - strcasecmp of 'string' and '' is => int(%d)
  432. - strcasecmp of 'string' and '1' is => int(%d)
  433. - strcasecmp of 'string' and '1' is => int(%d)
  434. - strcasecmp of 'string' and '' is => int(%d)
  435. - strcasecmp of 'string' and 'string' is => int(0)
  436. *** comparing the strings in an
  437. Array
  438. (
  439. [0] => 10.5
  440. [1] => 1.5
  441. [2] => 9.5
  442. [3] => 11.5
  443. [4] => 100.5
  444. [5] => 105
  445. [6] => -10.5
  446. [7] => 10
  447. [8] => 0.5
  448. )
  449. Iteration 0
  450. - strcasecmp of '10.5' and '10.5' is => int(0)
  451. - strcasecmp of '10.5' and '1.5' is => int(%d)
  452. - strcasecmp of '10.5' and '9.5' is => int(-%d)
  453. - strcasecmp of '10.5' and '11.5' is => int(-%d)
  454. - strcasecmp of '10.5' and '100.5' is => int(-%d)
  455. - strcasecmp of '10.5' and '105' is => int(-%d)
  456. - strcasecmp of '10.5' and '-10.5' is => int(%d)
  457. - strcasecmp of '10.5' and '10' is => int(%d)
  458. - strcasecmp of '10.5' and '0.5' is => int(%d)
  459. Iteration 1
  460. - strcasecmp of '1.5' and '10.5' is => int(-%d)
  461. - strcasecmp of '1.5' and '1.5' is => int(0)
  462. - strcasecmp of '1.5' and '9.5' is => int(-%d)
  463. - strcasecmp of '1.5' and '11.5' is => int(-%d)
  464. - strcasecmp of '1.5' and '100.5' is => int(-%d)
  465. - strcasecmp of '1.5' and '105' is => int(-%d)
  466. - strcasecmp of '1.5' and '-10.5' is => int(%d)
  467. - strcasecmp of '1.5' and '10' is => int(-%d)
  468. - strcasecmp of '1.5' and '0.5' is => int(%d)
  469. Iteration 2
  470. - strcasecmp of '9.5' and '10.5' is => int(%d)
  471. - strcasecmp of '9.5' and '1.5' is => int(%d)
  472. - strcasecmp of '9.5' and '9.5' is => int(0)
  473. - strcasecmp of '9.5' and '11.5' is => int(%d)
  474. - strcasecmp of '9.5' and '100.5' is => int(%d)
  475. - strcasecmp of '9.5' and '105' is => int(%d)
  476. - strcasecmp of '9.5' and '-10.5' is => int(%d)
  477. - strcasecmp of '9.5' and '10' is => int(%d)
  478. - strcasecmp of '9.5' and '0.5' is => int(%d)
  479. Iteration 3
  480. - strcasecmp of '11.5' and '10.5' is => int(%d)
  481. - strcasecmp of '11.5' and '1.5' is => int(%d)
  482. - strcasecmp of '11.5' and '9.5' is => int(-%d)
  483. - strcasecmp of '11.5' and '11.5' is => int(0)
  484. - strcasecmp of '11.5' and '100.5' is => int(%d)
  485. - strcasecmp of '11.5' and '105' is => int(%d)
  486. - strcasecmp of '11.5' and '-10.5' is => int(%d)
  487. - strcasecmp of '11.5' and '10' is => int(%d)
  488. - strcasecmp of '11.5' and '0.5' is => int(%d)
  489. Iteration 4
  490. - strcasecmp of '100.5' and '10.5' is => int(%d)
  491. - strcasecmp of '100.5' and '1.5' is => int(%d)
  492. - strcasecmp of '100.5' and '9.5' is => int(-%d)
  493. - strcasecmp of '100.5' and '11.5' is => int(-%d)
  494. - strcasecmp of '100.5' and '100.5' is => int(0)
  495. - strcasecmp of '100.5' and '105' is => int(-%d)
  496. - strcasecmp of '100.5' and '-10.5' is => int(%d)
  497. - strcasecmp of '100.5' and '10' is => int(%d)
  498. - strcasecmp of '100.5' and '0.5' is => int(%d)
  499. Iteration 5
  500. - strcasecmp of '105' and '10.5' is => int(%d)
  501. - strcasecmp of '105' and '1.5' is => int(%d)
  502. - strcasecmp of '105' and '9.5' is => int(-%d)
  503. - strcasecmp of '105' and '11.5' is => int(-%d)
  504. - strcasecmp of '105' and '100.5' is => int(%d)
  505. - strcasecmp of '105' and '105' is => int(0)
  506. - strcasecmp of '105' and '-10.5' is => int(%d)
  507. - strcasecmp of '105' and '10' is => int(%d)
  508. - strcasecmp of '105' and '0.5' is => int(%d)
  509. Iteration 6
  510. - strcasecmp of '-10.5' and '10.5' is => int(-%d)
  511. - strcasecmp of '-10.5' and '1.5' is => int(-%d)
  512. - strcasecmp of '-10.5' and '9.5' is => int(-%d)
  513. - strcasecmp of '-10.5' and '11.5' is => int(-%d)
  514. - strcasecmp of '-10.5' and '100.5' is => int(-%d)
  515. - strcasecmp of '-10.5' and '105' is => int(-%d)
  516. - strcasecmp of '-10.5' and '-10.5' is => int(0)
  517. - strcasecmp of '-10.5' and '10' is => int(-%d)
  518. - strcasecmp of '-10.5' and '0.5' is => int(-%d)
  519. Iteration 7
  520. - strcasecmp of '10' and '10.5' is => int(-%d)
  521. - strcasecmp of '10' and '1.5' is => int(%d)
  522. - strcasecmp of '10' and '9.5' is => int(-%d)
  523. - strcasecmp of '10' and '11.5' is => int(-%d)
  524. - strcasecmp of '10' and '100.5' is => int(-%d)
  525. - strcasecmp of '10' and '105' is => int(-%d)
  526. - strcasecmp of '10' and '-10.5' is => int(%d)
  527. - strcasecmp of '10' and '10' is => int(0)
  528. - strcasecmp of '10' and '0.5' is => int(%d)
  529. Iteration 8
  530. - strcasecmp of '0.5' and '10.5' is => int(-%d)
  531. - strcasecmp of '0.5' and '1.5' is => int(-%d)
  532. - strcasecmp of '0.5' and '9.5' is => int(-%d)
  533. - strcasecmp of '0.5' and '11.5' is => int(-%d)
  534. - strcasecmp of '0.5' and '100.5' is => int(-%d)
  535. - strcasecmp of '0.5' and '105' is => int(-%d)
  536. - strcasecmp of '0.5' and '-10.5' is => int(%d)
  537. - strcasecmp of '0.5' and '10' is => int(-%d)
  538. - strcasecmp of '0.5' and '0.5' is => int(0)
  539. #### Testing Miscelleneous inputs ####
  540. --- Testing objects ---
  541. int(-%d)
  542. --- Testing arrays ---
  543. Warning: strcasecmp() expects parameter 2 to be string, array given in %s on line %d
  544. NULL
  545. int(%d)
  546. int(%d)
  547. --- Testing Resources ---
  548. int(0)
  549. int(%d)
  550. --- Testing a longer and heredoc string ---
  551. int(0)
  552. int(-%d)
  553. int(%d)
  554. --- Testing a heredoc null string ---
  555. int(-%d)
  556. int(0)
  557. int(-%d)
  558. --- Testing simple and complex syntax strings ---
  559. int(-%d)
  560. int(-%d)
  561. Notice: Undefined variable: strS in %s on line %d
  562. int(%d)
  563. int(-%d)
  564. int(-%d)
  565. --- Testing binary safe and binary chars ---
  566. int(%d)
  567. int(-%d)
  568. int(0)
  569. int(0)
  570. int(%d)
  571. int(%d)
  572. int(%d)
  573. --- Comparing long float values ---
  574. int(0)
  575. int(-%d)
  576. int(0)
  577. #### checking error conditions ####
  578. Warning: strcasecmp() expects exactly 2 parameters, 0 given in %s on line %d
  579. Warning: strcasecmp() expects exactly 2 parameters, 1 given in %s on line %d
  580. Warning: strcasecmp() expects exactly 2 parameters, 1 given in %s on line %d
  581. Warning: strcasecmp() expects exactly 2 parameters, 3 given in %s on line %d
  582. Done