<?php
$array = [10, 20, 30, 40, 50];
extract(
(fn($a, $b, ...$c) => get_defined_vars())(...$array)
);
echo json_encode([$a, $b, $c]);
- Output for 7.4.0, 8.0.1 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.26, 8.4.1 - 8.4.13
- [10,20,[30,40,50]]
- Output for 7.0.0, 7.1.13, 7.2.0, 7.3.0
- Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW) in /in/TOgsk on line 8
Process exited with code 255.
preferences:
67.35 ms | 407 KiB | 5 Q