import zend standard tests
[hiphop-php.git] / hphp / test / zend / good / ext-standard-array / key_error.php
blob611729d8fa871f20a972f8be1d0a82ac39dc2119
1 <?php
2 /* Prototype : mixed key(array $array_arg)
3 * Description: Return the key of the element currently pointed to by the internal array pointer
4 * Source code: ext/standard/array.c
5 */
7 /*
8 * Pass incorrect number of arguments to key() to test behaviour
9 */
11 echo "*** Testing key() : error conditions ***\n";
13 // Zero arguments
14 echo "\n-- Testing key() function with Zero arguments --\n";
15 var_dump( key() );
17 //Test current with one more than the expected number of arguments
18 echo "\n-- Testing key() function with more than expected no. of arguments --\n";
19 $array_arg = array(1, 2);
20 $extra_arg = 10;
21 var_dump( key($array_arg, $extra_arg) );
23 ===DONE===