fork(1) download
  1. <?php
  2.  
  3. // your code goes here
  4. $arr = [1, 2, 3, 4, 5];
  5. var_dump(array_merge(...array_map(null, $arr, $arr)));
  6.  
Success #stdin #stdout 0.02s 23976KB
stdin
Standard input is empty
stdout
array(10) {
  [0]=>
  int(1)
  [1]=>
  int(1)
  [2]=>
  int(2)
  [3]=>
  int(2)
  [4]=>
  int(3)
  [5]=>
  int(3)
  [6]=>
  int(4)
  [7]=>
  int(4)
  [8]=>
  int(5)
  [9]=>
  int(5)
}