Skip to content

Instantly share code, notes, and snippets.



Created Sep 27, 2016
What would you like to do?
function sum() {
$sum = 0;
foreach (func_get_args() as $arg) {
$sum += $arg;
return $sum;
printf("%d\n", sum(1, 2));
printf("%d\n", sum(1, 2, 3));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.