diff options
Diffstat (limited to 'tests/lang/func_get_arg_variation.phpt')
-rw-r--r-- | tests/lang/func_get_arg_variation.phpt | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/lang/func_get_arg_variation.phpt b/tests/lang/func_get_arg_variation.phpt new file mode 100644 index 0000000..5dd0ed6 --- /dev/null +++ b/tests/lang/func_get_arg_variation.phpt @@ -0,0 +1,28 @@ +--TEST-- +func_get_arg test +--FILE-- +<?php + +function foo($a) +{ + $a=5; + echo func_get_arg(); + echo func_get_arg(2,2); + echo func_get_arg("hello"); + echo func_get_arg(-1); + echo func_get_arg(2); +} +foo(2); +echo "\n"; +?> +--EXPECTF-- +Warning: func_get_arg() expects exactly 1 parameter, 0 given in %s on line %d + +Warning: func_get_arg() expects exactly 1 parameter, 2 given in %s on line %d + +Warning: func_get_arg() expects parameter 1 to be long, string given in %s on line %d + +Warning: func_get_arg(): The argument number should be >= 0 in %s on line %d + +Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d + |