1
0
mirror of https://github.com/php/php-src.git synced 2026-04-12 02:23:18 +02:00
Files
archived-php-src/tests/lang/func_get_arg_variation.phpt
2020-07-21 14:47:03 +02:00

27 lines
519 B
PHP

--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 ($position) must be greater than or equal to 0
func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function