1--TEST-- 2Test crc32() function : error conditions 3--SKIPIF-- 4<?php 5if (PHP_INT_SIZE != 4) 6 die("skip this test is for 32bit platform only"); 7?> 8 9--FILE-- 10<?php 11/* Prototype : string crc32(string $str) 12 * Description: Calculate the crc32 polynomial of a string 13 * Source code: ext/standard/crc32.c 14 * Alias to functions: none 15*/ 16 17/* 18 * Testing crc32() : error conditions 19*/ 20 21echo "*** Testing crc32() : error conditions ***\n"; 22 23// Zero arguments 24echo "\n-- Testing crc32() function with Zero arguments --\n"; 25var_dump( crc32() ); 26 27//Test crc32 with one more than the expected number of arguments 28echo "\n-- Testing crc32() function with more than expected no. of arguments --\n"; 29$str = 'string_val'; 30$extra_arg = 10; 31var_dump( crc32($str, $extra_arg) ); 32 33echo "Done"; 34?> 35--EXPECTF-- 36*** Testing crc32() : error conditions *** 37 38-- Testing crc32() function with Zero arguments -- 39 40Warning: crc32() expects exactly 1 parameter, 0 given in %s on line %d 41NULL 42 43-- Testing crc32() function with more than expected no. of arguments -- 44 45Warning: crc32() expects exactly 1 parameter, 2 given in %s on line %d 46NULL 47Done 48