xref: /PHP-5.3/Zend/tests/020.phpt (revision 58a673a9)
1--TEST--
2func_get_arg() invalid usage
3--FILE--
4<?php
5
6var_dump(func_get_arg(1,2,3));
7var_dump(func_get_arg(1));
8var_dump(func_get_arg());
9
10function bar() {
11	var_dump(func_get_arg(1));
12}
13
14function foo() {
15	bar(func_get_arg(1));
16}
17
18foo(1,2);
19
20echo "Done\n";
21?>
22--EXPECTF--
23Warning: func_get_arg() expects exactly 1 parameter, 3 given in %s on line %d
24NULL
25
26Warning: func_get_arg():  Called from the global scope - no function context in %s on line %d
27bool(false)
28
29Warning: func_get_arg() expects exactly 1 parameter, 0 given in %s on line %d
30NULL
31
32Warning: func_get_arg():  Argument 1 not passed to function in %s on line %d
33bool(false)
34Done
35