xref: /PHP-8.1/tests/lang/func_get_arg.004.phpt (revision 5770b667)
1--TEST--
2func_get_arg on non-existent arg
3--FILE--
4<?php
5
6function foo($a)
7{
8    try {
9        var_dump(func_get_arg(2));
10    } catch (\Error $e) {
11        echo $e->getMessage() . \PHP_EOL;
12    }
13}
14foo(2, 3);
15
16?>
17--EXPECT--
18func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function
19