ID: 40569 User updated by: burg1 at gmx dot net Reported By: burg1 at gmx dot net Status: Bogus Bug Type: Documentation problem PHP Version: Irrelevant New Comment:
No! The three func_*_arg* pages only contain one example about the usage of the func_*_arg* function. The examples I am asking for are about the usage of variable-argument functions in general, and they (or similar) are not included anywhere in the docs. Why don't you just include them? More examples make the docs better, since anybody who is not interested can easily skip them. But for those who don't know how things work, examples are a GREAT way of showing. Previous Comments: ------------------------------------------------------------------------ [2007-03-23 16:02:52] [EMAIL PROTECTED] Examples are on the func_*_arg* pages which are linked from this section. ------------------------------------------------------------------------ [2007-02-20 23:16:02] burg1 at gmx dot net Description: ------------ Please include examples on how to define (and call) functions with a variable number of arguments: Example 17.11. Define a function with variable number of arguments: function test() { echo func_get_arg(0); } test('hello'); // prints 'hello' Example 17.12. Other method to define a function with optional second argument function test($foo, $bar=null) { echo $bar; } test('one','two'); // prints 'two' test('one'); // prints nothing Example 17.13. Wrong way to define a function with optional second argument function test($foo, $bar) { ... } test('one'); // gives warning, that argument 2 is missing for test() Why am I asking for this? Because the current explanation "No special syntax is required" is not very descriptive. So my first guess was the wrong way shown in Example 17.13 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=40569&edit=1