remove array_multisort and convert array_multisortN to use inout
[hiphop-php.git] / hphp / test / zend / good / ext / standard / tests / array / end_error.php
blobc7c12b7ec00c394901f119cf7d4eaba658d8530f
1 <?hh
2 /* Prototype : mixed end(array $array_arg)
3 * Description: Advances array argument's internal pointer to the last element and return it
4 * Source code: ext/standard/array.c
5 */
7 /*
8 * Pass incorrect number of arguments to end() to test behaviour
9 */
10 <<__EntryPoint>> function main(): void {
11 echo "*** Testing end() : error conditions ***\n";
13 // Zero arguments
14 echo "\n-- Testing end() function with Zero arguments --\n";
15 try { var_dump( end() ); } catch (Exception $e) { echo "\n".'Warning: '.$e->getMessage().' in '.__FILE__.' on line '.__LINE__."\n"; }
17 //Test end with one more than the expected number of arguments
18 echo "\n-- Testing end() function with more than expected no. of arguments --\n";
19 $array_arg = array(1, 2);
20 $extra_arg = 10;
21 try { var_dump( end(inout $array_arg, $extra_arg) ); } catch (Exception $e) { echo "\n".'Warning: '.$e->getMessage().' in '.__FILE__.' on line '.__LINE__."\n"; }
22 echo "===DONE===\n";