1--TEST--
2Test base64_decode() function : error conditions - wrong number of args
3--FILE--
4<?php
5/* Prototype  : proto string base64_decode(string str[, bool strict])
6 * Description: Decodes string using MIME base64 algorithm
7 * Source code: ext/standard/base64.c
8 * Alias to functions:
9 */
10
11echo "*** Testing base64_decode() : error conditions ***\n";
12
13// Zero arguments
14echo "\n-- Testing base64_decode() function with Zero arguments --\n";
15var_dump( base64_decode() );
16
17//Test base64_decode with one more than the expected number of arguments
18echo "\n-- Testing base64_decode() function with more than expected no. of arguments --\n";
19$str = 'string_val';
20$strict = true;
21$extra_arg = 10;
22var_dump( base64_decode($str, $strict, $extra_arg) );
23
24echo "Done";
25?>
26--EXPECTF--
27*** Testing base64_decode() : error conditions ***
28
29-- Testing base64_decode() function with Zero arguments --
30
31Warning: base64_decode() expects at least 1 parameter, 0 given in %s on line 12
32NULL
33
34-- Testing base64_decode() function with more than expected no. of arguments --
35
36Warning: base64_decode() expects at most 2 parameters, 3 given in %s on line 19
37NULL
38Done
39