Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. <?php
  2.  
  3. function one(...$a){
  4. print_r($a);
  5. two(...$a);
  6. }
  7.  
  8. function two ($a,$b,$c){
  9. print_r(['a'=>$a, 'b'=>$b, 'c'=>$c]);
  10. }
  11.  
  12. one('this is a', 'this is b', 'this is c', 'this is d');
  13.  
  14. // Result:
  15. // Array ( [0] => this is a [1] => this is b [2] => this is c [3] => this is d )
  16. // Array ( [a] => this is a [b] => this is b [c] => this is c )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement