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