Updates to Tomato RAF including NGINX && PHP
[tomato.git] / release / src / router / php / ext / standard / tests / strings / crc32_variation3.phpt
blob639254a5f499f0dfa6018c1963346ef38bdcadbc
1 --TEST--
2 Test crc32() function : usage variations - double quoted strings
3 --SKIPIF--
4 <?php
5 if (PHP_INT_SIZE != 4)
6   die("skip this test is for 32bit platform only");
7 ?>
8 --FILE--
9 <?php
10 /* Prototype  : string crc32(string $str)
11  * Description: Calculate the crc32 polynomial of a string 
12  * Source code: ext/standard/crc32.c
13  * Alias to functions: none
17  * Testing crc32() : with different strings in double quotes passed to the function
20 echo "*** Testing crc32() : with different strings in double quotes ***\n";
22 // defining an array of strings
23 $string_array = array(
24   "",
25   " ",
26   "hello world",
27   "HELLO WORLD",
28   " helloworld ",
30   "(hello world)",
31   "hello(world)",
32   "helloworld()",
33   "hello()(world",
35   "'hello' world",
36   "hello 'world'",
37   "hello''world",
39   "hello\tworld",
40   "hellowor\\tld",
41   "\thello world\t",
42   "helloworld",
43   "hellowor\\ld",
44   "hello\nworld",
45   "hellowor\\nld",
46   "\nhello world\n",
47   "\n\thelloworld",
48   "hel\tlo\n world",
50   "!@#$%&",
51   "#hello@world.com",
52   "$hello$world",
54   "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbb
55    cccccccccccccccccccccccccccccccccddddddddddddddddddddddddddddddddd
56    eeeeeeeeeeeeeeeeeeeeeeeeeeeeffffffffffffffffffffffffffffffffffffff
57    gggggggggggggggggggggggggggggggggggggggggghhhhhhhhhhhhhhhhhhhhhhhh
58    111111111111111111111122222222222222222222222222222222222222222222
59    333333333333333333333333333333333334444444444444444444444444444444
60    555555555555555555555555555555555555555555556666666666666666666666
61    777777777777777777777777777777777777777777777777777777777777777777
62    /t/t/t/t/t/t/t/t/t/t/t/t/t/t/t/t/t/t/t/t/t/t/t/t/t/t/t/t/t/t/t/t/t
63    /n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n"
66 // looping to check the behaviour of the function for each string in the array
68 $count = 1; 
69 foreach($string_array as $str) {
70   echo "\n-- Iteration $count --\n";
71   var_dump( crc32($str) );
72   $count++;
75 echo "Done";
77 --EXPECTF--
78 *** Testing crc32() : with different strings in double quotes ***
80 Notice: Undefined variable: hello in %s on line %d
82 Notice: Undefined variable: world in %s on line %d
84 -- Iteration 1 --
85 int(0)
87 -- Iteration 2 --
88 int(-378745019)
90 -- Iteration 3 --
91 int(222957957)
93 -- Iteration 4 --
94 int(-2015000997)
96 -- Iteration 5 --
97 int(1234261835)
99 -- Iteration 6 --
100 int(-1867296214)
102 -- Iteration 7 --
103 int(1048577080)
105 -- Iteration 8 --
106 int(2129739710)
108 -- Iteration 9 --
109 int(-1633247628)
111 -- Iteration 10 --
112 int(1191242624)
114 -- Iteration 11 --
115 int(603128807)
117 -- Iteration 12 --
118 int(-525789576)
120 -- Iteration 13 --
121 int(770262395)
123 -- Iteration 14 --
124 int(243585859)
126 -- Iteration 15 --
127 int(-986324846)
129 -- Iteration 16 --
130 int(-102031187)
132 -- Iteration 17 --
133 int(-588181215)
135 -- Iteration 18 --
136 int(-1417857067)
138 -- Iteration 19 --
139 int(523630053)
141 -- Iteration 20 --
142 int(-503915034)
144 -- Iteration 21 --
145 int(-254912432)
147 -- Iteration 22 --
148 int(-1581578467)
150 -- Iteration 23 --
151 int(-1828940657)
153 -- Iteration 24 --
154 int(-1654468652)
156 -- Iteration 25 --
157 int(0)
159 -- Iteration 26 --
160 int(1431761713)
161 Done