note 65976 added to function.func-num-args
| From: | neelam_ab2003 at yahoo dot co dot in | Date: | Thu, 11 May 2006 07:40:07 +0000 |
| Subject: | note 65976 added to function.func-num-args | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-111114@lists.php.net to get a copy of this message | ||
Just adding a note to JARED's Note.
func_num_args() works if and only if called from within a function definition BECAUSE it calculates
the number of arguments sent while function calling. That is why it gives
'1' in helloWorld("HelloWorld!") and '2' in
helloWorld("HelloWorld!", "HowdyWorld!") - There is nothing to do with DEFAULT
args.
If you call the same function as helloWorld(); "No args passed"
It will give a warning for wrong function call ("Warning: Missing argument 1 for
helloWorld()") and the result of func_num_args() will be '0'.
----
Server IP: 66.163.161.117
Probable Submitter: 61.247.235.49
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.func-num-args.php
Edit -- http://master.php.net/note/edit/65976
Del: integrated -- http://master.php.net/note/delete/65976/integrated
Del: useless -- http://master.php.net/note/delete/65976/useless
Del: bad code -- http://master.php.net/note/delete/65976/bad+code
Del: spam -- http://master.php.net/note/delete/65976/spam
Del: non-english -- http://master.php.net/note/delete/65976/non-english
Del: in docs -- http://master.php.net/note/delete/65976/in+docs
Del: other reasons-- http://master.php.net/note/delete/65976
Reject -- http://master.php.net/note/reject/65976
Search -- http://master.php.net/manage/user-notes.php