Last active
March 1, 2019 07:52
-
-
Save nurullahisik/3e28eb778108e06185c509dd4edec95c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Example 1 */ | |
// yes, the argument list can be empty | |
function foo() { | |
// returns an array of all passed arguments | |
$args = func_get_args(); | |
foreach ($args as $k => $v) { | |
echo "arg".($k+1).": $v\n"; | |
} | |
} | |
foo(); | |
/* prints nothing */ | |
foo('hello'); | |
/* prints | |
arg1: hello | |
*/ | |
foo('hello', 'world', 'again'); | |
/* prints | |
arg1: hello | |
arg2: world | |
arg3: again | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment