Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function foo($a1 = null, $a2 = null, $a3 = null, $a4 = null){
- if ($a1 !== null) doSomethingWith($a1, 1);
- if ($a2 !== null) doSomethingWith($a2, 2);
- if ($a3 !== null) doSomethingWith($a3, 3);
- if ($a4 !== null) doSomethingWith($a4, 4);
- }
- function foo(params $args){
- for ($i = 0; $i < count($args); $i++)
- doSomethingWith($args[$i], $i + 1);
- }
Add Comment
Please, Sign In to add comment