what is the significance of the three dots in this function signature
linkedin assesment quizzes php
Q25. What is the significance of the three dots in this function signature?
function process(...$vals) {
// do some processing
}
- It makes the function variadic, allowing it to accept as an argument an array containing an arbitrary number of values.
- It makes the function variadic, allowing it to accept an arbitrary number of arguments that are converted into an array inside the function.
- It temporarily disables the function while debugging other parts of the script.
- It’s a placeholder like a TO DO reminder that automatically triggers a notice when you run a script before completing the function definition.