2 Test crc32() function : usage variations - double quoted strings
6 die("skip this test is for 32bit platform only");
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(
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
69 foreach($string_array as $str) {
70 echo "\n-- Iteration $count --\n";
71 var_dump( crc32($str) );
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