<?php
$a = [1,2,3];
$z=[4, ...$a];
var_dump($z);
- Output for 7.4.4 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
- array(4) {
[0]=>
int(4)
[1]=>
int(1)
[2]=>
int(2)
[3]=>
int(3)
}
- Output for 5.6.38, 7.1.0 - 7.1.23, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33
- Parse error: syntax error, unexpected '...' (T_ELLIPSIS), expecting ']' in /in/bgqv6 on line 4
Process exited with code 255.
preferences:
170.75 ms | 402 KiB | 168 Q