xref: /PHP-8.1/tests/lang/func_get_arg.003.phpt (revision 55a3e5b9)
1--TEST--
2func_get_arg outside of a function declaration
3--FILE--
4<?php
5
6try {
7    var_dump(func_get_arg(0));
8} catch (\Error $e) {
9    echo $e->getMessage() . \PHP_EOL;
10}
11
12?>
13--EXPECT--
14func_get_arg() cannot be called from the global scope
15