<?php
$array = [10, 20, 30, 40, 50];
//$array = [10, 20, 30, 40];
//$array = [10, 20, 30];
//$array = [10, 20];
[$a, $b, ...$c] = $array;
var_export(compact(['a', 'b', 'c']));
- Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
- Fatal error: Spread operator is not supported in assignments in /in/pJGDl on line 8
Process exited with code 255.
preferences:
149.01 ms | 1431 KiB | 7 Q