1--TEST--
2Test current() function : error conditions - Pass incorrect number of args
3--FILE--
4<?php
5/* Prototype  : mixed current(array $array_arg)
6 * Description: Return the element currently pointed to by the internal array pointer
7 * Source code: ext/standard/array.c
8 * Alias to functions: pos
9 */
10
11/*
12 * Pass incorrect number of arguments to current() to test behaviour
13 */
14
15echo "*** Testing current() : error conditions ***\n";
16
17// Zero arguments
18echo "\n-- Testing current() function with Zero arguments --\n";
19var_dump( current() );
20
21//Test current with one more than the expected number of arguments
22echo "\n-- Testing current() function with more than expected no. of arguments --\n";
23$array_arg = array(1, 2);
24$extra_arg = 10;
25var_dump( current($array_arg, $extra_arg) );
26?>
27===DONE===
28--EXPECTF--
29*** Testing current() : error conditions ***
30
31-- Testing current() function with Zero arguments --
32
33Warning: current() expects exactly 1 parameter, 0 given in %s on line %d
34NULL
35
36-- Testing current() function with more than expected no. of arguments --
37
38Warning: current() expects exactly 1 parameter, 2 given in %s on line %d
39NULL
40===DONE===
41