Posted by Arjun Arjun on Thursday 18th February 2016, 1 minute read

PHP get function arguments as array?

splat operator PHP5.6

func_get_args() returns an array with all arguments of the current function.


PHP5.6 - splat operator

Arrays and Traversable objects can be unpacked into argument lists when calling functions by using the ... operator. This is also known as the splat operator in other languages.


...
Arjun

I am Arjun from Hyderabad (India). I have been working as a software engineer from the last 7+ years, and it is my passion to learn new things and implement them as a practice. Aside from work, I like gardening and spending time with pets.