Annotation of embedaddon/php/ext/standard/tests/strings/strnatcasecmp_variation1.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test strnatcasecmp() function : variation
3: --CREDITS--
4: Felix De Vliegher <felix.devliegher@gmail.com>
5: --FILE--
6: <?php
7: /* Prototype : int strnatcasecmp(string s1, string s2)
8: * Description: Returns the result of case-insensitive string comparison using 'natural' algorithm
9: * Source code: ext/standard/string.c
10: * Alias to functions:
11: */
12:
13: /* Preparation */
14: class a
15: {
16: function __toString()
17: {
18: return "Hello WORLD";
19: }
20: }
21:
22: class b
23: {
24: function __toString()
25: {
26: return "HELLO world";
27: }
28: }
29:
30: $a = new a();
31: $b = new b();
32:
33: function str_dump($a, $b) {
34: var_dump(strnatcasecmp($a, $b));
35: }
36:
37: echo "*** Testing strnatcasecmp() : variation ***\n";
38:
39: str_dump('0', false);
40: str_dump('fooBar', '');
41: str_dump('', -1);
42: str_dump("Hello\0world", "Helloworld");
43: str_dump("\x0", "\0");
44: str_dump($a, $b);
45:
46: ?>
47: ===DONE===
48: --EXPECT--
49: *** Testing strnatcasecmp() : variation ***
50: int(1)
51: int(6)
52: int(-2)
53: int(-1)
54: int(0)
55: int(0)
56: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>