3v4l.org

run code in 300+ PHP versions simultaneously
<?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:
150.03 ms | 1400 KiB | 64 Q