xref: /PHP-7.3/ext/standard/tests/strings/strcmp.phpt (revision 782352c5)
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
64echo "\n--- Testing Resources ---\n";
65$filename1 = "dummy.txt";
66$filename2 = "dummy1.txt";
67
68$file1 = fopen($filename1, "w");                // creating new file
69$file2 = fopen($filename2, "w");                // creating new file
70
71/* getting resource type for file handle */
72$string1 = get_resource_type($file1);
73$string2 = get_resource_type($file2);
74$string3 = (int)get_resource_type($file2);
75
76/* string1 and string2 of same "stream" type */
77var_dump(strcmp($string1, $string2));            // int(0)
78
79/* string1 is of "stream" type & string3 is of "int" type */
80var_dump(strcmp($string1, $string3));            // int(1)
81
82fclose($file1);                                 // closing the file "dummy.txt"
83fclose($file2);                                 // closing the file "dummy1.txt"
84
85unlink("$filename1");                           // deletes "dummy.txt"
86unlink("$filename2");                           // deletes "dummy1.txt"
87
88
89echo "\n--- Testing a longer and heredoc string ---\n";
90$string = <<<EOD
91abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789
92abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789
93abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789
94abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789
95abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789
96abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789
97abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789
98@#$%^&**&^%$#@!~:())))((((&&&**%$###@@@!!!~~~~@###$%^&*
99abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789
100EOD;
101var_dump(strcmp($string, $string));
102var_dump(strcmp($string, "xyz0123456789"));
103var_dump(strcmp($string, "&&&"));
104
105echo "\n--- Testing a heredoc null string ---\n";
106$str = <<<EOD
107EOD;
108var_dump(strcmp($str, "\0"));
109var_dump(strcmp($str, NULL));
110var_dump(strcmp($str, "0"));
111
112
113echo "\n--- Testing simple and complex syntax strings ---\n";
114$str = 'world';
115
116/* Simple syntax */
117var_dump(strcmp("Hello, world", "$str"));
118var_dump(strcmp("Hello, world'S", "$str'S"));
119var_dump(strcmp("Hello, worldS", "$strS"));
120
121/* String with curly braces, complex syntax */
122var_dump(strcmp("Hello, worldS", "${str}S"));
123var_dump(strcmp("Hello, worldS", "{$str}S"));
124
125echo "\n--- Testing binary safe and binary chars ---\n";
126var_dump(strcmp("Hello\0world", "Hello"));
127var_dump(strcmp("Hello\0world", "Helloworld"));
128var_dump(strcmp("\x0", "\0"));
129var_dump(strcmp("\000", "\0"));
130var_dump(strcmp("\x00", ""));
131var_dump(strcmp("\x00", NULL));
132var_dump(strcmp("\000", NULL));
133
134echo "\n--- Comparing long float values ---\n";
135/* Here two different outputs, which depends on the rounding value
136   before converting to string. Here Precision = 12  */
137var_dump(strcmp(10.55555555555555555555555555, 10.5555555556));   // int(0)
138var_dump(strcmp(10.55555555555555555555555555, 10.555555556));    // int(-1)
139var_dump(strcmp(10.55555555595555555555555555, 10.555555556));    // int(0)
140
141
142echo "\n#### checking error conditions ####";
143strcmp();
144strcmp("");
145strcmp("HI");
146strcmp("Hi", "Hello", "World");
147
148echo "Done\n";
149?>
150--EXPECTF--
151#### Basic and Possible operations ####
152*** comparing the strings in an
153Array
154(
155    [0] => a
156    [1] => A
157    [2] => a
158    [3] => A
159    [4] => �
160    [5] => �
161    [6] => �
162)
163
164Iteration 0
165- strcmp of 'a' and 'a' is => int(0)
166- strcmp of 'a' and 'A' is => int(%d)
167- strcmp of 'a' and 'a' is => int(0)
168- strcmp of 'a' and 'A' is => int(%d)
169- strcmp of 'a' and '�' is => int(-%d)
170- strcmp of 'a' and '�' is => int(-%d)
171- strcmp of 'a' and '�' is => int(%d)
172
173Iteration 1
174- strcmp of 'A' and 'a' is => int(-%d)
175- strcmp of 'A' and 'A' is => int(0)
176- strcmp of 'A' and 'a' is => int(-%d)
177- strcmp of 'A' and 'A' is => int(0)
178- strcmp of 'A' and '�' is => int(-%d)
179- strcmp of 'A' and '�' is => int(-%d)
180- strcmp of 'A' and '�' is => int(%d)
181
182Iteration 2
183- strcmp of 'a' and 'a' is => int(0)
184- strcmp of 'a' and 'A' is => int(%d)
185- strcmp of 'a' and 'a' is => int(0)
186- strcmp of 'a' and 'A' is => int(%d)
187- strcmp of 'a' and '�' is => int(-%d)
188- strcmp of 'a' and '�' is => int(-%d)
189- strcmp of 'a' and '�' is => int(%d)
190
191Iteration 3
192- strcmp of 'A' and 'a' is => int(-%d)
193- strcmp of 'A' and 'A' is => int(0)
194- strcmp of 'A' and 'a' is => int(-%d)
195- strcmp of 'A' and 'A' is => int(0)
196- strcmp of 'A' and '�' is => int(-%d)
197- strcmp of 'A' and '�' is => int(-%d)
198- strcmp of 'A' and '�' is => int(%d)
199
200Iteration 4
201- strcmp of '�' and 'a' is => int(%d)
202- strcmp of '�' and 'A' is => int(%d)
203- strcmp of '�' and 'a' is => int(%d)
204- strcmp of '�' and 'A' is => int(%d)
205- strcmp of '�' and '�' is => int(0)
206- strcmp of '�' and '�' is => int(-%d)
207- strcmp of '�' and '�' is => int(%d)
208
209Iteration 5
210- strcmp of '�' and 'a' is => int(%d)
211- strcmp of '�' and 'A' is => int(%d)
212- strcmp of '�' and 'a' is => int(%d)
213- strcmp of '�' and 'A' is => int(%d)
214- strcmp of '�' and '�' is => int(%d)
215- strcmp of '�' and '�' is => int(0)
216- strcmp of '�' and '�' is => int(%d)
217
218Iteration 6
219- strcmp of '�' and 'a' is => int(-%d)
220- strcmp of '�' and 'A' is => int(-%d)
221- strcmp of '�' and 'a' is => int(-%d)
222- strcmp of '�' and 'A' is => int(-%d)
223- strcmp of '�' and '�' is => int(-%d)
224- strcmp of '�' and '�' is => int(-%d)
225- strcmp of '�' and '�' is => int(0)
226
227*** comparing the strings in an
228Array
229(
230    [0] => acc
231    [1] => Acc
232    [2] => ac
233    [3] => accc
234    [4] => acd
235    [5] => ?acc
236    [6] => acc!
237    [7] => $!acc
238    [8] => ;acc
239)
240
241Iteration 0
242- strcmp of 'acc' and 'acc' is => int(0)
243- strcmp of 'acc' and 'Acc' is => int(%d)
244- strcmp of 'acc' and 'ac' is => int(%d)
245- strcmp of 'acc' and 'accc' is => int(-%d)
246- strcmp of 'acc' and 'acd' is => int(-%d)
247- strcmp of 'acc' and '?acc' is => int(%d)
248- strcmp of 'acc' and 'acc!' is => int(-%d)
249- strcmp of 'acc' and '$!acc' is => int(%d)
250- strcmp of 'acc' and ';acc' is => int(%d)
251
252Iteration 1
253- strcmp of 'Acc' and 'acc' is => int(-%d)
254- strcmp of 'Acc' and 'Acc' is => int(0)
255- strcmp of 'Acc' and 'ac' is => int(-%d)
256- strcmp of 'Acc' and 'accc' is => int(-%d)
257- strcmp of 'Acc' and 'acd' is => int(-%d)
258- strcmp of 'Acc' and '?acc' is => int(%d)
259- strcmp of 'Acc' and 'acc!' is => int(-%d)
260- strcmp of 'Acc' and '$!acc' is => int(%d)
261- strcmp of 'Acc' and ';acc' is => int(%d)
262
263Iteration 2
264- strcmp of 'ac' and 'acc' is => int(-%d)
265- strcmp of 'ac' and 'Acc' is => int(%d)
266- strcmp of 'ac' and 'ac' is => int(0)
267- strcmp of 'ac' and 'accc' is => int(-%d)
268- strcmp of 'ac' and 'acd' is => int(-%d)
269- strcmp of 'ac' and '?acc' is => int(%d)
270- strcmp of 'ac' and 'acc!' is => int(-%d)
271- strcmp of 'ac' and '$!acc' is => int(%d)
272- strcmp of 'ac' and ';acc' is => int(%d)
273
274Iteration 3
275- strcmp of 'accc' and 'acc' is => int(%d)
276- strcmp of 'accc' and 'Acc' is => int(%d)
277- strcmp of 'accc' and 'ac' is => int(%d)
278- strcmp of 'accc' and 'accc' is => int(0)
279- strcmp of 'accc' and 'acd' is => int(-%d)
280- strcmp of 'accc' and '?acc' is => int(%d)
281- strcmp of 'accc' and 'acc!' is => int(%d)
282- strcmp of 'accc' and '$!acc' is => int(%d)
283- strcmp of 'accc' and ';acc' is => int(%d)
284
285Iteration 4
286- strcmp of 'acd' and 'acc' is => int(%d)
287- strcmp of 'acd' and 'Acc' is => int(%d)
288- strcmp of 'acd' and 'ac' is => int(%d)
289- strcmp of 'acd' and 'accc' is => int(%d)
290- strcmp of 'acd' and 'acd' is => int(0)
291- strcmp of 'acd' and '?acc' is => int(%d)
292- strcmp of 'acd' and 'acc!' is => int(%d)
293- strcmp of 'acd' and '$!acc' is => int(%d)
294- strcmp of 'acd' and ';acc' is => int(%d)
295
296Iteration 5
297- strcmp of '?acc' and 'acc' is => int(-%d)
298- strcmp of '?acc' and 'Acc' is => int(-%d)
299- strcmp of '?acc' and 'ac' is => int(-%d)
300- strcmp of '?acc' and 'accc' is => int(-%d)
301- strcmp of '?acc' and 'acd' is => int(-%d)
302- strcmp of '?acc' and '?acc' is => int(0)
303- strcmp of '?acc' and 'acc!' is => int(-%d)
304- strcmp of '?acc' and '$!acc' is => int(%d)
305- strcmp of '?acc' and ';acc' is => int(%d)
306
307Iteration 6
308- strcmp of 'acc!' and 'acc' is => int(%d)
309- strcmp of 'acc!' and 'Acc' is => int(%d)
310- strcmp of 'acc!' and 'ac' is => int(%d)
311- strcmp of 'acc!' and 'accc' is => int(-%d)
312- strcmp of 'acc!' and 'acd' is => int(-%d)
313- strcmp of 'acc!' and '?acc' is => int(%d)
314- strcmp of 'acc!' and 'acc!' is => int(0)
315- strcmp of 'acc!' and '$!acc' is => int(%d)
316- strcmp of 'acc!' and ';acc' is => int(%d)
317
318Iteration 7
319- strcmp of '$!acc' and 'acc' is => int(-%d)
320- strcmp of '$!acc' and 'Acc' is => int(-%d)
321- strcmp of '$!acc' and 'ac' is => int(-%d)
322- strcmp of '$!acc' and 'accc' is => int(-%d)
323- strcmp of '$!acc' and 'acd' is => int(-%d)
324- strcmp of '$!acc' and '?acc' is => int(-%d)
325- strcmp of '$!acc' and 'acc!' is => int(-%d)
326- strcmp of '$!acc' and '$!acc' is => int(0)
327- strcmp of '$!acc' and ';acc' is => int(-%d)
328
329Iteration 8
330- strcmp of ';acc' and 'acc' is => int(-%d)
331- strcmp of ';acc' and 'Acc' is => int(-%d)
332- strcmp of ';acc' and 'ac' is => int(-%d)
333- strcmp of ';acc' and 'accc' is => int(-%d)
334- strcmp of ';acc' and 'acd' is => int(-%d)
335- strcmp of ';acc' and '?acc' is => int(-%d)
336- strcmp of ';acc' and 'acc!' is => int(-%d)
337- strcmp of ';acc' and '$!acc' is => int(%d)
338- strcmp of ';acc' and ';acc' is => int(0)
339
340*** comparing the strings in an
341Array
342(
343    [0] => 1
344    [1] => 0
345    [2] => 0
346    [3] => -1
347    [4] => -1
348    [5] =>
349    [6] =>
350    [7] => 1
351    [8] =>
352    [9] => string
353)
354
355Iteration 0
356- strcmp of '1' and '1' is => int(0)
357- strcmp of '1' and '0' is => int(%d)
358- strcmp of '1' and '0' is => int(%d)
359- strcmp of '1' and '-1' is => int(%d)
360- strcmp of '1' and '-1' is => int(%d)
361- strcmp of '1' and '' is => int(%d)
362- strcmp of '1' and '' is => int(%d)
363- strcmp of '1' and '1' is => int(0)
364- strcmp of '1' and '' is => int(%d)
365- strcmp of '1' and 'string' is => int(-%d)
366
367Iteration 1
368- strcmp of '0' and '1' is => int(-%d)
369- strcmp of '0' and '0' is => int(0)
370- strcmp of '0' and '0' is => int(0)
371- strcmp of '0' and '-1' is => int(%d)
372- strcmp of '0' and '-1' is => int(%d)
373- strcmp of '0' and '' is => int(%d)
374- strcmp of '0' and '' is => int(%d)
375- strcmp of '0' and '1' is => int(-%d)
376- strcmp of '0' and '' is => int(%d)
377- strcmp of '0' and 'string' is => int(-%d)
378
379Iteration 2
380- strcmp of '0' and '1' is => int(-%d)
381- strcmp of '0' and '0' is => int(0)
382- strcmp of '0' and '0' is => int(0)
383- strcmp of '0' and '-1' is => int(%d)
384- strcmp of '0' and '-1' is => int(%d)
385- strcmp of '0' and '' is => int(%d)
386- strcmp of '0' and '' is => int(%d)
387- strcmp of '0' and '1' is => int(-%d)
388- strcmp of '0' and '' is => int(%d)
389- strcmp of '0' and 'string' is => int(-%d)
390
391Iteration 3
392- strcmp of '-1' and '1' is => int(-%d)
393- strcmp of '-1' and '0' is => int(-%d)
394- strcmp of '-1' and '0' is => int(-%d)
395- strcmp of '-1' and '-1' is => int(0)
396- strcmp of '-1' and '-1' is => int(0)
397- strcmp of '-1' and '' is => int(%d)
398- strcmp of '-1' and '' is => int(%d)
399- strcmp of '-1' and '1' is => int(-%d)
400- strcmp of '-1' and '' is => int(%d)
401- strcmp of '-1' and 'string' is => int(-%d)
402
403Iteration 4
404- strcmp of '-1' and '1' is => int(-%d)
405- strcmp of '-1' and '0' is => int(-%d)
406- strcmp of '-1' and '0' is => int(-%d)
407- strcmp of '-1' and '-1' is => int(0)
408- strcmp of '-1' and '-1' is => int(0)
409- strcmp of '-1' and '' is => int(%d)
410- strcmp of '-1' and '' is => int(%d)
411- strcmp of '-1' and '1' is => int(-%d)
412- strcmp of '-1' and '' is => int(%d)
413- strcmp of '-1' and 'string' is => int(-%d)
414
415Iteration 5
416- strcmp of '' and '1' is => int(-%d)
417- strcmp of '' and '0' is => int(-%d)
418- strcmp of '' and '0' is => int(-%d)
419- strcmp of '' and '-1' is => int(-%d)
420- strcmp of '' and '-1' is => int(-%d)
421- strcmp of '' and '' is => int(0)
422- strcmp of '' and '' is => int(0)
423- strcmp of '' and '1' is => int(-%d)
424- strcmp of '' and '' is => int(0)
425- strcmp of '' and 'string' is => int(-%d)
426
427Iteration 6
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 7
440- strcmp of '1' and '1' is => int(0)
441- strcmp of '1' and '0' is => int(%d)
442- strcmp of '1' and '0' is => int(%d)
443- strcmp of '1' and '-1' is => int(%d)
444- strcmp of '1' and '-1' is => int(%d)
445- strcmp of '1' and '' is => int(%d)
446- strcmp of '1' and '' is => int(%d)
447- strcmp of '1' and '1' is => int(0)
448- strcmp of '1' and '' is => int(%d)
449- strcmp of '1' and 'string' is => int(-%d)
450
451Iteration 8
452- strcmp of '' and '1' is => int(-%d)
453- strcmp of '' and '0' is => int(-%d)
454- strcmp of '' and '0' is => int(-%d)
455- strcmp of '' and '-1' is => int(-%d)
456- strcmp of '' and '-1' is => int(-%d)
457- strcmp of '' and '' is => int(0)
458- strcmp of '' and '' is => int(0)
459- strcmp of '' and '1' is => int(-%d)
460- strcmp of '' and '' is => int(0)
461- strcmp of '' and 'string' is => int(-%d)
462
463Iteration 9
464- strcmp of 'string' and '1' is => int(%d)
465- strcmp of 'string' and '0' is => int(%d)
466- strcmp of 'string' and '0' is => int(%d)
467- strcmp of 'string' and '-1' is => int(%d)
468- strcmp of 'string' and '-1' is => int(%d)
469- strcmp of 'string' and '' is => int(%d)
470- strcmp of 'string' and '' is => int(%d)
471- strcmp of 'string' and '1' is => int(%d)
472- strcmp of 'string' and '' is => int(%d)
473- strcmp of 'string' and 'string' is => int(0)
474
475*** comparing the strings in an
476Array
477(
478    [0] => 10.5
479    [1] => 1.5
480    [2] => 9.5
481    [3] => 11.5
482    [4] => 100.5
483    [5] => 105
484    [6] => -10.5
485    [7] => 10
486    [8] => 0.5
487)
488
489Iteration 0
490- strcmp of '10.5' and '10.5' is => int(0)
491- strcmp of '10.5' and '1.5' is => int(%d)
492- strcmp of '10.5' and '9.5' is => int(-%d)
493- strcmp of '10.5' and '11.5' is => int(-%d)
494- strcmp of '10.5' and '100.5' is => int(-%d)
495- strcmp of '10.5' and '105' is => int(-%d)
496- strcmp of '10.5' and '-10.5' is => int(%d)
497- strcmp of '10.5' and '10' is => int(%d)
498- strcmp of '10.5' and '0.5' is => int(%d)
499
500Iteration 1
501- strcmp of '1.5' and '10.5' is => int(-%d)
502- strcmp of '1.5' and '1.5' is => int(0)
503- strcmp of '1.5' and '9.5' is => int(-%d)
504- strcmp of '1.5' and '11.5' is => int(-%d)
505- strcmp of '1.5' and '100.5' is => int(-%d)
506- strcmp of '1.5' and '105' is => int(-%d)
507- strcmp of '1.5' and '-10.5' is => int(%d)
508- strcmp of '1.5' and '10' is => int(-%d)
509- strcmp of '1.5' and '0.5' is => int(%d)
510
511Iteration 2
512- strcmp of '9.5' and '10.5' is => int(%d)
513- strcmp of '9.5' and '1.5' is => int(%d)
514- strcmp of '9.5' and '9.5' is => int(0)
515- strcmp of '9.5' and '11.5' is => int(%d)
516- strcmp of '9.5' and '100.5' is => int(%d)
517- strcmp of '9.5' and '105' is => int(%d)
518- strcmp of '9.5' and '-10.5' is => int(%d)
519- strcmp of '9.5' and '10' is => int(%d)
520- strcmp of '9.5' and '0.5' is => int(%d)
521
522Iteration 3
523- strcmp of '11.5' and '10.5' is => int(%d)
524- strcmp of '11.5' and '1.5' is => int(%d)
525- strcmp of '11.5' and '9.5' is => int(-%d)
526- strcmp of '11.5' and '11.5' is => int(0)
527- strcmp of '11.5' and '100.5' is => int(%d)
528- strcmp of '11.5' and '105' is => int(%d)
529- strcmp of '11.5' and '-10.5' is => int(%d)
530- strcmp of '11.5' and '10' is => int(%d)
531- strcmp of '11.5' and '0.5' is => int(%d)
532
533Iteration 4
534- strcmp of '100.5' and '10.5' is => int(%d)
535- strcmp of '100.5' and '1.5' is => int(%d)
536- strcmp of '100.5' and '9.5' is => int(-%d)
537- strcmp of '100.5' and '11.5' is => int(-%d)
538- strcmp of '100.5' and '100.5' is => int(0)
539- strcmp of '100.5' and '105' is => int(-%d)
540- strcmp of '100.5' and '-10.5' is => int(%d)
541- strcmp of '100.5' and '10' is => int(%d)
542- strcmp of '100.5' and '0.5' is => int(%d)
543
544Iteration 5
545- strcmp of '105' and '10.5' is => int(%d)
546- strcmp of '105' and '1.5' is => int(%d)
547- strcmp of '105' and '9.5' is => int(-%d)
548- strcmp of '105' and '11.5' is => int(-%d)
549- strcmp of '105' and '100.5' is => int(%d)
550- strcmp of '105' and '105' is => int(0)
551- strcmp of '105' and '-10.5' is => int(%d)
552- strcmp of '105' and '10' is => int(%d)
553- strcmp of '105' and '0.5' is => int(%d)
554
555Iteration 6
556- strcmp of '-10.5' and '10.5' is => int(-%d)
557- strcmp of '-10.5' and '1.5' is => int(-%d)
558- strcmp of '-10.5' and '9.5' is => int(-%d)
559- strcmp of '-10.5' and '11.5' is => int(-%d)
560- strcmp of '-10.5' and '100.5' is => int(-%d)
561- strcmp of '-10.5' and '105' is => int(-%d)
562- strcmp of '-10.5' and '-10.5' is => int(0)
563- strcmp of '-10.5' and '10' is => int(-%d)
564- strcmp of '-10.5' and '0.5' is => int(-%d)
565
566Iteration 7
567- strcmp of '10' and '10.5' is => int(-%d)
568- strcmp of '10' and '1.5' is => int(%d)
569- strcmp of '10' and '9.5' is => int(-%d)
570- strcmp of '10' and '11.5' is => int(-%d)
571- strcmp of '10' and '100.5' is => int(-%d)
572- strcmp of '10' and '105' is => int(-%d)
573- strcmp of '10' and '-10.5' is => int(%d)
574- strcmp of '10' and '10' is => int(0)
575- strcmp of '10' and '0.5' is => int(%d)
576
577Iteration 8
578- strcmp of '0.5' and '10.5' is => int(-%d)
579- strcmp of '0.5' and '1.5' is => int(-%d)
580- strcmp of '0.5' and '9.5' is => int(-%d)
581- strcmp of '0.5' and '11.5' is => int(-%d)
582- strcmp of '0.5' and '100.5' is => int(-%d)
583- strcmp of '0.5' and '105' is => int(-%d)
584- strcmp of '0.5' and '-10.5' is => int(%d)
585- strcmp of '0.5' and '10' is => int(-%d)
586- strcmp of '0.5' and '0.5' is => int(0)
587
588#### Testing Miscelleneous inputs ####
589--- Testing objects ---
590int(-%d)
591
592--- Testing arrays ---
593
594Warning: strcmp() expects parameter 2 to be string, array given in %s on line %d
595NULL
596int(%d)
597int(%d)
598
599--- Testing Resources ---
600int(0)
601int(%d)
602
603--- Testing a longer and heredoc string ---
604int(0)
605int(-%d)
606int(%d)
607
608--- Testing a heredoc null string ---
609int(-%d)
610int(0)
611int(-%d)
612
613--- Testing simple and complex syntax strings ---
614int(-%d)
615int(-%d)
616
617Notice: Undefined variable: strS in %s on line %d
618int(%d)
619int(-%d)
620int(-%d)
621
622--- Testing binary safe and binary chars ---
623int(%d)
624int(-%d)
625int(0)
626int(0)
627int(%d)
628int(%d)
629int(%d)
630
631--- Comparing long float values ---
632int(0)
633int(-%d)
634int(0)
635
636#### checking error conditions ####
637Warning: strcmp() expects exactly 2 parameters, 0 given in %s on line %d
638
639Warning: strcmp() expects exactly 2 parameters, 1 given in %s on line %d
640
641Warning: strcmp() expects exactly 2 parameters, 1 given in %s on line %d
642
643Warning: strcmp() expects exactly 2 parameters, 3 given in %s on line %d
644Done
645