1
0
mirror of https://github.com/php/php-src.git synced 2026-04-19 14:01:01 +02:00
Files
archived-php-src/Zend/tests/020.phpt
2020-03-31 16:32:58 +02:00

30 lines
452 B
PHP

--TEST--
func_get_arg() invalid usage
--FILE--
<?php
try {
var_dump(func_get_arg(1));
} catch (\Error $e) {
echo $e->getMessage() . \PHP_EOL;
}
function bar() {
var_dump(func_get_arg(1));
}
function foo() {
bar(func_get_arg(1));
}
try {
foo(1,2);
} catch (\Error $e) {
echo $e->getMessage() . \PHP_EOL;
}
?>
--EXPECT--
func_get_arg() cannot be called from the global scope
func_get_arg(): Argument 1 not passed to function