summaryrefslogtreecommitdiff
path: root/tests/lang/func_get_arg_variation.phpt
blob: eb608ad0f06d8343a3e84e5a9d1339bc9a8cfbaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--TEST--
func_get_arg test
--FILE--
<?php

function foo($a)
{
   $a=5;
   try {
       echo func_get_arg(-1);
   } catch (\Error $e) {
       echo $e->getMessage() . \PHP_EOL;
   }

   try {
       echo func_get_arg(2);
   } catch (\Error $e) {
       echo $e->getMessage() . \PHP_EOL;
   }
}
foo(2);

?>
--EXPECT--
func_get_arg(): Argument #1 ($arg_num) must be greater than or equal to 0
func_get_arg(): Argument 2 not passed to function