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
8 * Pass incorrect number of arguments to end() to test behaviour
10 <<__EntryPoint
>> function main(): void
{
11 echo "*** Testing end() : error conditions ***\n";
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);
21 try { var_dump( end(inout
$array_arg, $extra_arg) ); } catch (Exception
$e) { echo "\n".'Warning: '.$e->getMessage().' in '.__FILE__
.' on line '.__LINE__
."\n"; }