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--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
14*/
15
16/*
17 * Testing crc32() : error conditions
18*/
19
20echo "*** Testing crc32() : error conditions ***\n";
21
22// Zero arguments
23echo "\n-- Testing crc32() function with Zero arguments --\n";
24var_dump( crc32() );
25
26//Test crc32 with one more than the expected number of arguments
27echo "\n-- Testing crc32() function with more than expected no. of arguments --\n";
28$str = 'string_val';
29$extra_arg = 10;
30var_dump( crc32($str, $extra_arg) );
31
32echo "Done";
33?>
34--EXPECTF--
35*** Testing crc32() : error conditions ***
36
37-- Testing crc32() function with Zero arguments --
38
39Warning: crc32() expects exactly 1 parameter, 0 given in %s on line %d
40NULL
41
42-- Testing crc32() function with more than expected no. of arguments --
43
44Warning: crc32() expects exactly 1 parameter, 2 given in %s on line %d
45NULL
46Done
47