1--TEST--
2func_get_arg test
3--FILE--
4<?php
5
6function foo($a)
7{
8   $a=5;
9   try {
10       echo func_get_arg(-1);
11   } catch (\Error $e) {
12       echo $e->getMessage() . \PHP_EOL;
13   }
14
15   try {
16       echo func_get_arg(2);
17   } catch (\Error $e) {
18       echo $e->getMessage() . \PHP_EOL;
19   }
20}
21foo(2);
22
23?>
24--EXPECT--
25func_get_arg(): Argument #1 ($position) must be greater than or equal to 0
26func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
27