In PHP, when defining a function what is the maximum number of arguments that you can create? This isn’t something I am doing, just a question that popped up when discussing it with a colleague 🙂
Would this be purely down a memory limitation? effectively unlimited?
Arguments to a function are pushed on a stack, after which the function is called which in turn reads the stack and uses those values as parameters.
So as long as the stack isn’t full, you can keep adding parameters, but it’ll depend on the situation, and at design-time you won’t know the stack size.
But I really hope this is pure a technical discussion and you don’t need it IRL. 😉