note 108500 added to functions.arguments
| From: | BobsForumReplies at yahoo dot com | Date: | Wed, 02 May 2012 03:23:05 +0000 |
| Subject: | note 108500 added to functions.arguments | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-187423@lists.php.net to get a copy of this message | ||
Here, Here!
Not enough can be said for consistent syntax across languages and for easy to understand syntax.
PHP makes it much harder than need be to omit some, but not all, parameters in a function call (by
the way, the world I grew up in called the values being passed "argument", not parameters
- see http://en.wikipedia.org/wiki/Function_argument
for an excellent definition of argument and parameter)
As was said here, why not allow a caller to omit an argument by just coding the comma?
function example(one, two, three, four, five)
call it with only first and last arguments:
example(oneValue, , , , fiveValue)
If the language provides a way to set a default value for each argument or a way to detect that an
argument has not been specified, all is copacetic and the world spins round easily, the birds sing,
the bees buzz, and all is peaceful in Programming Land.
Bob
----
Server IP: 69.147.83.197
Probable Submitter: 99.188.231.210
----
Manual Page -- http://www.php.net/manual/en/functions.arguments.php
Edit -- https://master.php.net/note/edit/108500
Del: integrated -- https://master.php.net/note/delete/108500/integrated
Del: useless -- https://master.php.net/note/delete/108500/useless
Del: bad code -- https://master.php.net/note/delete/108500/bad+code
Del: spam -- https://master.php.net/note/delete/108500/spam
Del: non-english -- https://master.php.net/note/delete/108500/non-english
Del: in docs -- https://master.php.net/note/delete/108500/in+docs
Del: other reasons-- https://master.php.net/note/delete/108500
Reject -- https://master.php.net/note/reject/108500
Search -- https://master.php.net/manage/user-notes.php