note 5288 deleted from functions.arguments by felipe
| From: | felipe@php.net | Date: | Sat, 29 Dec 2007 18:02:17 +0000 |
| Subject: | note 5288 deleted from functions.arguments by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-134142@lists.php.net to get a copy of this message | ||
Note Submitter: ak at avatartech dot com
Reason: 2
----
One interesting thing I've noticed:
function foo() { // accepts any number of arguments
bar()
}
function bar($x,$y) { // same
print("$x $y");
}
foo("one","two);
OUPUT: "one two"
That is, PHP will automatically pass all the variables passed to foo() into bar() if you don't
pass them explicitly. I'm not sure how far this extends (i.e. if you pass just one variable,
will the rest still get tacked on? etc), but it's interesting, and undocumented.