strcmp.phpt 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. --TEST--
  2. strcmp() function
  3. --INI--
  4. precision = 12
  5. --FILE--
  6. <?php
  7. /* Compares two strings in case-sensitive manner */
  8. echo "#### Basic and Possible operations ####";
  9. /* creating an array of strings to be compared */
  10. $arrays = array(
  11. array("a", "A", '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, "", 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 "- strcmp of '$str1_arr[$i]' and '$str1_arr[$j]' is => ";
  25. var_dump(strcmp($str1_arr[$i], $str1_arr[$j]));
  26. }
  27. }
  28. }
  29. echo "\n#### Testing miscellaneous inputs ####\n";
  30. echo "--- Testing objects ---\n";
  31. /* we get "Recoverable 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(strcmp("$obj_string1", "$obj_string2"));
  47. echo "\n--- Testing arrays ---\n";
  48. $str_arr = array("hello", "?world", "!$%**()%**[][[[&@#~!");
  49. var_dump(strcmp("hello?world,!$%**()%**[][[[&@#~!", "$str_arr[1]"));
  50. var_dump(strcmp("hello?world,!$%**()%**[][[[&@#~!", "$str_arr[2]"));
  51. echo "\n--- Testing a longer and heredoc string ---\n";
  52. $string = <<<EOD
  53. abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789
  54. abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789
  55. abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789
  56. abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789
  57. abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789
  58. abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789
  59. abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789
  60. @#$%^&**&^%$#@!~:())))((((&&&**%$###@@@!!!~~~~@###$%^&*
  61. abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789
  62. EOD;
  63. var_dump(strcmp($string, $string));
  64. var_dump(strcmp($string, "xyz0123456789"));
  65. var_dump(strcmp($string, "&&&"));
  66. echo "\n--- Testing a heredoc null string ---\n";
  67. $str = <<<EOD
  68. EOD;
  69. var_dump(strcmp($str, "\0"));
  70. var_dump(strcmp($str, "0"));
  71. echo "\n--- Testing simple and complex syntax strings ---\n";
  72. $str = 'world';
  73. /* Simple syntax */
  74. var_dump(strcmp("Hello, world", "$str"));
  75. var_dump(strcmp("Hello, world'S", "$str'S"));
  76. var_dump(strcmp("Hello, worldS", "$strS"));
  77. /* String with curly braces, complex syntax */
  78. var_dump(strcmp("Hello, worldS", "${str}S"));
  79. var_dump(strcmp("Hello, worldS", "{$str}S"));
  80. echo "\n--- Testing binary safe and binary chars ---\n";
  81. var_dump(strcmp("Hello\0world", "Hello"));
  82. var_dump(strcmp("Hello\0world", "Helloworld"));
  83. var_dump(strcmp("\x0", "\0"));
  84. var_dump(strcmp("\000", "\0"));
  85. var_dump(strcmp("\x00", ""));
  86. echo "\n--- Comparing long float values ---\n";
  87. /* Here two different outputs, which depends on the rounding value
  88. before converting to string. Here Precision = 12 */
  89. var_dump(strcmp(10.55555555555555555555555555, 10.5555555556)); // int(0)
  90. var_dump(strcmp(10.55555555555555555555555555, 10.555555556)); // int(-1)
  91. var_dump(strcmp(10.55555555595555555555555555, 10.555555556)); // int(0)
  92. echo "Done\n";
  93. ?>
  94. --EXPECTF--
  95. #### Basic and Possible operations ####
  96. *** comparing the strings in an
  97. Array
  98. (
  99. [0] => a
  100. [1] => A
  101. [2] => a
  102. [3] => A
  103. [4] => €
  104. [5] => ÿ
  105. [6] => %0
  106. )
  107. Iteration 0
  108. - strcmp of 'a' and 'a' is => int(0)
  109. - strcmp of 'a' and 'A' is => int(%d)
  110. - strcmp of 'a' and 'a' is => int(0)
  111. - strcmp of 'a' and 'A' is => int(%d)
  112. - strcmp of 'a' and '€' is => int(-%d)
  113. - strcmp of 'a' and 'ÿ' is => int(-%d)
  114. - strcmp of 'a' and '%0' is => int(%d)
  115. Iteration 1
  116. - strcmp of 'A' and 'a' is => int(-%d)
  117. - strcmp of 'A' and 'A' is => int(0)
  118. - strcmp of 'A' and 'a' is => int(-%d)
  119. - strcmp of 'A' and 'A' is => int(0)
  120. - strcmp of 'A' and '€' is => int(-%d)
  121. - strcmp of 'A' and 'ÿ' is => int(-%d)
  122. - strcmp of 'A' and '%0' is => int(%d)
  123. Iteration 2
  124. - strcmp of 'a' and 'a' is => int(0)
  125. - strcmp of 'a' and 'A' is => int(%d)
  126. - strcmp of 'a' and 'a' is => int(0)
  127. - strcmp of 'a' and 'A' is => int(%d)
  128. - strcmp of 'a' and '€' is => int(-%d)
  129. - strcmp of 'a' and 'ÿ' is => int(-%d)
  130. - strcmp of 'a' and '%0' is => int(%d)
  131. Iteration 3
  132. - strcmp of 'A' and 'a' is => int(-%d)
  133. - strcmp of 'A' and 'A' is => int(0)
  134. - strcmp of 'A' and 'a' is => int(-%d)
  135. - strcmp of 'A' and 'A' is => int(0)
  136. - strcmp of 'A' and '€' is => int(-%d)
  137. - strcmp of 'A' and 'ÿ' is => int(-%d)
  138. - strcmp of 'A' and '%0' is => int(%d)
  139. Iteration 4
  140. - strcmp of '€' and 'a' is => int(%d)
  141. - strcmp of '€' and 'A' is => int(%d)
  142. - strcmp of '€' and 'a' is => int(%d)
  143. - strcmp of '€' and 'A' is => int(%d)
  144. - strcmp of '€' and '€' is => int(0)
  145. - strcmp of '€' and 'ÿ' is => int(-%d)
  146. - strcmp of '€' and '%0' is => int(%d)
  147. Iteration 5
  148. - strcmp of 'ÿ' and 'a' is => int(%d)
  149. - strcmp of 'ÿ' and 'A' is => int(%d)
  150. - strcmp of 'ÿ' and 'a' is => int(%d)
  151. - strcmp of 'ÿ' and 'A' is => int(%d)
  152. - strcmp of 'ÿ' and '€' is => int(%d)
  153. - strcmp of 'ÿ' and 'ÿ' is => int(0)
  154. - strcmp of 'ÿ' and '%0' is => int(%d)
  155. Iteration 6
  156. - strcmp of '%0' and 'a' is => int(-%d)
  157. - strcmp of '%0' and 'A' is => int(-%d)
  158. - strcmp of '%0' and 'a' is => int(-%d)
  159. - strcmp of '%0' and 'A' is => int(-%d)
  160. - strcmp of '%0' and '€' is => int(-%d)
  161. - strcmp of '%0' and 'ÿ' is => int(-%d)
  162. - strcmp of '%0' and '%0' is => int(0)
  163. *** comparing the strings in an
  164. Array
  165. (
  166. [0] => acc
  167. [1] => Acc
  168. [2] => ac
  169. [3] => accc
  170. [4] => acd
  171. [5] => ?acc
  172. [6] => acc!
  173. [7] => $!acc
  174. [8] => ;acc
  175. )
  176. Iteration 0
  177. - strcmp of 'acc' and 'acc' is => int(0)
  178. - strcmp of 'acc' and 'Acc' is => int(%d)
  179. - strcmp of 'acc' and 'ac' is => int(%d)
  180. - strcmp of 'acc' and 'accc' is => int(-%d)
  181. - strcmp of 'acc' and 'acd' is => int(-%d)
  182. - strcmp of 'acc' and '?acc' is => int(%d)
  183. - strcmp of 'acc' and 'acc!' is => int(-%d)
  184. - strcmp of 'acc' and '$!acc' is => int(%d)
  185. - strcmp of 'acc' and ';acc' is => int(%d)
  186. Iteration 1
  187. - strcmp of 'Acc' and 'acc' is => int(-%d)
  188. - strcmp of 'Acc' and 'Acc' is => int(0)
  189. - strcmp of 'Acc' and 'ac' is => int(-%d)
  190. - strcmp of 'Acc' and 'accc' is => int(-%d)
  191. - strcmp of 'Acc' and 'acd' is => int(-%d)
  192. - strcmp of 'Acc' and '?acc' is => int(%d)
  193. - strcmp of 'Acc' and 'acc!' is => int(-%d)
  194. - strcmp of 'Acc' and '$!acc' is => int(%d)
  195. - strcmp of 'Acc' and ';acc' is => int(%d)
  196. Iteration 2
  197. - strcmp of 'ac' and 'acc' is => int(-%d)
  198. - strcmp of 'ac' and 'Acc' is => int(%d)
  199. - strcmp of 'ac' and 'ac' is => int(0)
  200. - strcmp of 'ac' and 'accc' is => int(-%d)
  201. - strcmp of 'ac' and 'acd' is => int(-%d)
  202. - strcmp of 'ac' and '?acc' is => int(%d)
  203. - strcmp of 'ac' and 'acc!' is => int(-%d)
  204. - strcmp of 'ac' and '$!acc' is => int(%d)
  205. - strcmp of 'ac' and ';acc' is => int(%d)
  206. Iteration 3
  207. - strcmp of 'accc' and 'acc' is => int(%d)
  208. - strcmp of 'accc' and 'Acc' is => int(%d)
  209. - strcmp of 'accc' and 'ac' is => int(%d)
  210. - strcmp of 'accc' and 'accc' is => int(0)
  211. - strcmp of 'accc' and 'acd' is => int(-%d)
  212. - strcmp of 'accc' and '?acc' is => int(%d)
  213. - strcmp of 'accc' and 'acc!' is => int(%d)
  214. - strcmp of 'accc' and '$!acc' is => int(%d)
  215. - strcmp of 'accc' and ';acc' is => int(%d)
  216. Iteration 4
  217. - strcmp of 'acd' and 'acc' is => int(%d)
  218. - strcmp of 'acd' and 'Acc' is => int(%d)
  219. - strcmp of 'acd' and 'ac' is => int(%d)
  220. - strcmp of 'acd' and 'accc' is => int(%d)
  221. - strcmp of 'acd' and 'acd' is => int(0)
  222. - strcmp of 'acd' and '?acc' is => int(%d)
  223. - strcmp of 'acd' and 'acc!' is => int(%d)
  224. - strcmp of 'acd' and '$!acc' is => int(%d)
  225. - strcmp of 'acd' and ';acc' is => int(%d)
  226. Iteration 5
  227. - strcmp of '?acc' and 'acc' is => int(-%d)
  228. - strcmp of '?acc' and 'Acc' is => int(-%d)
  229. - strcmp of '?acc' and 'ac' is => int(-%d)
  230. - strcmp of '?acc' and 'accc' is => int(-%d)
  231. - strcmp of '?acc' and 'acd' is => int(-%d)
  232. - strcmp of '?acc' and '?acc' is => int(0)
  233. - strcmp of '?acc' and 'acc!' is => int(-%d)
  234. - strcmp of '?acc' and '$!acc' is => int(%d)
  235. - strcmp of '?acc' and ';acc' is => int(%d)
  236. Iteration 6
  237. - strcmp of 'acc!' and 'acc' is => int(%d)
  238. - strcmp of 'acc!' and 'Acc' is => int(%d)
  239. - strcmp of 'acc!' and 'ac' is => int(%d)
  240. - strcmp of 'acc!' and 'accc' is => int(-%d)
  241. - strcmp of 'acc!' and 'acd' is => int(-%d)
  242. - strcmp of 'acc!' and '?acc' is => int(%d)
  243. - strcmp of 'acc!' and 'acc!' is => int(0)
  244. - strcmp of 'acc!' and '$!acc' is => int(%d)
  245. - strcmp of 'acc!' and ';acc' is => int(%d)
  246. Iteration 7
  247. - strcmp of '$!acc' and 'acc' is => int(-%d)
  248. - strcmp of '$!acc' and 'Acc' is => int(-%d)
  249. - strcmp of '$!acc' and 'ac' is => int(-%d)
  250. - strcmp of '$!acc' and 'accc' is => int(-%d)
  251. - strcmp of '$!acc' and 'acd' is => int(-%d)
  252. - strcmp of '$!acc' and '?acc' is => int(-%d)
  253. - strcmp of '$!acc' and 'acc!' is => int(-%d)
  254. - strcmp of '$!acc' and '$!acc' is => int(0)
  255. - strcmp of '$!acc' and ';acc' is => int(-%d)
  256. Iteration 8
  257. - strcmp of ';acc' and 'acc' is => int(-%d)
  258. - strcmp of ';acc' and 'Acc' is => int(-%d)
  259. - strcmp of ';acc' and 'ac' is => int(-%d)
  260. - strcmp of ';acc' and 'accc' is => int(-%d)
  261. - strcmp of ';acc' and 'acd' is => int(-%d)
  262. - strcmp of ';acc' and '?acc' is => int(-%d)
  263. - strcmp of ';acc' and 'acc!' is => int(-%d)
  264. - strcmp of ';acc' and '$!acc' is => int(%d)
  265. - strcmp of ';acc' and ';acc' is => int(0)
  266. *** comparing the strings in an
  267. Array
  268. (
  269. [0] => 1
  270. [1] => 0
  271. [2] => 0
  272. [3] => -1
  273. [4] => -1
  274. [5] =>
  275. [6] => 1
  276. [7] =>
  277. [8] => string
  278. )
  279. Iteration 0
  280. - strcmp of '1' and '1' is => int(0)
  281. - strcmp of '1' and '0' is => int(%d)
  282. - strcmp of '1' and '0' is => int(%d)
  283. - strcmp of '1' and '-1' is => int(%d)
  284. - strcmp of '1' and '-1' is => int(%d)
  285. - strcmp of '1' and '' is => int(%d)
  286. - strcmp of '1' and '1' is => int(0)
  287. - strcmp of '1' and '' is => int(%d)
  288. - strcmp of '1' and 'string' is => int(-%d)
  289. Iteration 1
  290. - strcmp of '0' and '1' is => int(-%d)
  291. - strcmp of '0' and '0' is => int(0)
  292. - strcmp of '0' and '0' is => int(0)
  293. - strcmp of '0' and '-1' is => int(%d)
  294. - strcmp of '0' and '-1' is => int(%d)
  295. - strcmp of '0' and '' is => int(%d)
  296. - strcmp of '0' and '1' is => int(-%d)
  297. - strcmp of '0' and '' is => int(%d)
  298. - strcmp of '0' and 'string' is => int(-%d)
  299. Iteration 2
  300. - strcmp of '0' and '1' is => int(-%d)
  301. - strcmp of '0' and '0' is => int(0)
  302. - strcmp of '0' and '0' is => int(0)
  303. - strcmp of '0' and '-1' is => int(%d)
  304. - strcmp of '0' and '-1' is => int(%d)
  305. - strcmp of '0' and '' is => int(%d)
  306. - strcmp of '0' and '1' is => int(-%d)
  307. - strcmp of '0' and '' is => int(%d)
  308. - strcmp of '0' and 'string' is => int(-%d)
  309. Iteration 3
  310. - strcmp of '-1' and '1' is => int(-%d)
  311. - strcmp of '-1' and '0' is => int(-%d)
  312. - strcmp of '-1' and '0' is => int(-%d)
  313. - strcmp of '-1' and '-1' is => int(0)
  314. - strcmp of '-1' and '-1' is => int(0)
  315. - strcmp of '-1' and '' is => int(%d)
  316. - strcmp of '-1' and '1' is => int(-%d)
  317. - strcmp of '-1' and '' is => int(%d)
  318. - strcmp of '-1' and 'string' is => int(-%d)
  319. Iteration 4
  320. - strcmp of '-1' and '1' is => int(-%d)
  321. - strcmp of '-1' and '0' is => int(-%d)
  322. - strcmp of '-1' and '0' is => int(-%d)
  323. - strcmp of '-1' and '-1' is => int(0)
  324. - strcmp of '-1' and '-1' is => int(0)
  325. - strcmp of '-1' and '' is => int(%d)
  326. - strcmp of '-1' and '1' is => int(-%d)
  327. - strcmp of '-1' and '' is => int(%d)
  328. - strcmp of '-1' and 'string' is => int(-%d)
  329. Iteration 5
  330. - strcmp of '' and '1' is => int(-%d)
  331. - strcmp of '' and '0' is => int(-%d)
  332. - strcmp of '' and '0' is => int(-%d)
  333. - strcmp of '' and '-1' is => int(-%d)
  334. - strcmp of '' and '-1' is => int(-%d)
  335. - strcmp of '' and '' is => int(0)
  336. - strcmp of '' and '1' is => int(-%d)
  337. - strcmp of '' and '' is => int(0)
  338. - strcmp of '' and 'string' is => int(-%d)
  339. Iteration 6
  340. - strcmp of '1' and '1' is => int(0)
  341. - strcmp of '1' and '0' is => int(%d)
  342. - strcmp of '1' and '0' is => int(%d)
  343. - strcmp of '1' and '-1' is => int(%d)
  344. - strcmp of '1' and '-1' is => int(%d)
  345. - strcmp of '1' and '' is => int(%d)
  346. - strcmp of '1' and '1' is => int(0)
  347. - strcmp of '1' and '' is => int(%d)
  348. - strcmp of '1' and 'string' is => int(-%d)
  349. Iteration 7
  350. - strcmp of '' and '1' is => int(-%d)
  351. - strcmp of '' and '0' is => int(-%d)
  352. - strcmp of '' and '0' is => int(-%d)
  353. - strcmp of '' and '-1' is => int(-%d)
  354. - strcmp of '' and '-1' is => int(-%d)
  355. - strcmp of '' and '' is => int(0)
  356. - strcmp of '' and '1' is => int(-%d)
  357. - strcmp of '' and '' is => int(0)
  358. - strcmp of '' and 'string' is => int(-%d)
  359. Iteration 8
  360. - strcmp of 'string' and '1' is => int(%d)
  361. - strcmp of 'string' and '0' is => int(%d)
  362. - strcmp of 'string' and '0' is => int(%d)
  363. - strcmp of 'string' and '-1' is => int(%d)
  364. - strcmp of 'string' and '-1' is => int(%d)
  365. - strcmp of 'string' and '' is => int(%d)
  366. - strcmp of 'string' and '1' is => int(%d)
  367. - strcmp of 'string' and '' is => int(%d)
  368. - strcmp of 'string' and 'string' is => int(0)
  369. *** comparing the strings in an
  370. Array
  371. (
  372. [0] => 10.5
  373. [1] => 1.5
  374. [2] => 9.5
  375. [3] => 11.5
  376. [4] => 100.5
  377. [5] => 105
  378. [6] => -10.5
  379. [7] => 10
  380. [8] => 0.5
  381. )
  382. Iteration 0
  383. - strcmp of '10.5' and '10.5' is => int(0)
  384. - strcmp of '10.5' and '1.5' is => int(%d)
  385. - strcmp of '10.5' and '9.5' is => int(-%d)
  386. - strcmp of '10.5' and '11.5' is => int(-%d)
  387. - strcmp of '10.5' and '100.5' is => int(-%d)
  388. - strcmp of '10.5' and '105' is => int(-%d)
  389. - strcmp of '10.5' and '-10.5' is => int(%d)
  390. - strcmp of '10.5' and '10' is => int(%d)
  391. - strcmp of '10.5' and '0.5' is => int(%d)
  392. Iteration 1
  393. - strcmp of '1.5' and '10.5' is => int(-%d)
  394. - strcmp of '1.5' and '1.5' is => int(0)
  395. - strcmp of '1.5' and '9.5' is => int(-%d)
  396. - strcmp of '1.5' and '11.5' is => int(-%d)
  397. - strcmp of '1.5' and '100.5' is => int(-%d)
  398. - strcmp of '1.5' and '105' is => int(-%d)
  399. - strcmp of '1.5' and '-10.5' is => int(%d)
  400. - strcmp of '1.5' and '10' is => int(-%d)
  401. - strcmp of '1.5' and '0.5' is => int(%d)
  402. Iteration 2
  403. - strcmp of '9.5' and '10.5' is => int(%d)
  404. - strcmp of '9.5' and '1.5' is => int(%d)
  405. - strcmp of '9.5' and '9.5' is => int(0)
  406. - strcmp of '9.5' and '11.5' is => int(%d)
  407. - strcmp of '9.5' and '100.5' is => int(%d)
  408. - strcmp of '9.5' and '105' is => int(%d)
  409. - strcmp of '9.5' and '-10.5' is => int(%d)
  410. - strcmp of '9.5' and '10' is => int(%d)
  411. - strcmp of '9.5' and '0.5' is => int(%d)
  412. Iteration 3
  413. - strcmp of '11.5' and '10.5' is => int(%d)
  414. - strcmp of '11.5' and '1.5' is => int(%d)
  415. - strcmp of '11.5' and '9.5' is => int(-%d)
  416. - strcmp of '11.5' and '11.5' is => int(0)
  417. - strcmp of '11.5' and '100.5' is => int(%d)
  418. - strcmp of '11.5' and '105' is => int(%d)
  419. - strcmp of '11.5' and '-10.5' is => int(%d)
  420. - strcmp of '11.5' and '10' is => int(%d)
  421. - strcmp of '11.5' and '0.5' is => int(%d)
  422. Iteration 4
  423. - strcmp of '100.5' and '10.5' is => int(%d)
  424. - strcmp of '100.5' and '1.5' is => int(%d)
  425. - strcmp of '100.5' and '9.5' is => int(-%d)
  426. - strcmp of '100.5' and '11.5' is => int(-%d)
  427. - strcmp of '100.5' and '100.5' is => int(0)
  428. - strcmp of '100.5' and '105' is => int(-%d)
  429. - strcmp of '100.5' and '-10.5' is => int(%d)
  430. - strcmp of '100.5' and '10' is => int(%d)
  431. - strcmp of '100.5' and '0.5' is => int(%d)
  432. Iteration 5
  433. - strcmp of '105' and '10.5' is => int(%d)
  434. - strcmp of '105' and '1.5' is => int(%d)
  435. - strcmp of '105' and '9.5' is => int(-%d)
  436. - strcmp of '105' and '11.5' is => int(-%d)
  437. - strcmp of '105' and '100.5' is => int(%d)
  438. - strcmp of '105' and '105' is => int(0)
  439. - strcmp of '105' and '-10.5' is => int(%d)
  440. - strcmp of '105' and '10' is => int(%d)
  441. - strcmp of '105' and '0.5' is => int(%d)
  442. Iteration 6
  443. - strcmp of '-10.5' and '10.5' is => int(-%d)
  444. - strcmp of '-10.5' and '1.5' is => int(-%d)
  445. - strcmp of '-10.5' and '9.5' is => int(-%d)
  446. - strcmp of '-10.5' and '11.5' is => int(-%d)
  447. - strcmp of '-10.5' and '100.5' is => int(-%d)
  448. - strcmp of '-10.5' and '105' is => int(-%d)
  449. - strcmp of '-10.5' and '-10.5' is => int(0)
  450. - strcmp of '-10.5' and '10' is => int(-%d)
  451. - strcmp of '-10.5' and '0.5' is => int(-%d)
  452. Iteration 7
  453. - strcmp of '10' and '10.5' is => int(-%d)
  454. - strcmp of '10' and '1.5' is => int(%d)
  455. - strcmp of '10' and '9.5' is => int(-%d)
  456. - strcmp of '10' and '11.5' is => int(-%d)
  457. - strcmp of '10' and '100.5' is => int(-%d)
  458. - strcmp of '10' and '105' is => int(-%d)
  459. - strcmp of '10' and '-10.5' is => int(%d)
  460. - strcmp of '10' and '10' is => int(0)
  461. - strcmp of '10' and '0.5' is => int(%d)
  462. Iteration 8
  463. - strcmp of '0.5' and '10.5' is => int(-%d)
  464. - strcmp of '0.5' and '1.5' is => int(-%d)
  465. - strcmp of '0.5' and '9.5' is => int(-%d)
  466. - strcmp of '0.5' and '11.5' is => int(-%d)
  467. - strcmp of '0.5' and '100.5' is => int(-%d)
  468. - strcmp of '0.5' and '105' is => int(-%d)
  469. - strcmp of '0.5' and '-10.5' is => int(%d)
  470. - strcmp of '0.5' and '10' is => int(-%d)
  471. - strcmp of '0.5' and '0.5' is => int(0)
  472. #### Testing miscellaneous inputs ####
  473. --- Testing objects ---
  474. int(-%d)
  475. --- Testing arrays ---
  476. int(%d)
  477. int(%d)
  478. --- Testing a longer and heredoc string ---
  479. int(0)
  480. int(-%d)
  481. int(%d)
  482. --- Testing a heredoc null string ---
  483. int(-%d)
  484. int(-%d)
  485. --- Testing simple and complex syntax strings ---
  486. int(-%d)
  487. int(-%d)
  488. Warning: Undefined variable $strS in %s on line %d
  489. int(%d)
  490. int(-%d)
  491. int(-%d)
  492. --- Testing binary safe and binary chars ---
  493. int(%d)
  494. int(-%d)
  495. int(0)
  496. int(0)
  497. int(%d)
  498. --- Comparing long float values ---
  499. int(0)
  500. int(-%d)
  501. int(0)
  502. Done