Intermediate
PHP
Q87 / 100
What is PHP's splat in array unpacking?
Correct! Well done.
Incorrect.
The correct answer is B) Using ... to unpack an array into positional values: [$first, ...$rest] = $array or [...$a, ...$b]
B
Correct Answer
Using ... to unpack an array into positional values: [$first, ...$rest] = $array or [...$a, ...$b]
Explanation
PHP 8.1 allows array unpacking with string keys: [...$defaults, ...$overrides]. The splat creates a merged array with later values overwriting earlier ones.
Progress
87/100