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