Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Functions - Maximum number of arguments

Tags:

php

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?

like image 346
bagwaa Avatar asked Nov 08 '11 11:11

bagwaa


1 Answers

There is no limit. And you can always use func_get_args(), func_get_arg() and func_num_args() to avoid writing all the arguments in the function definition.

like image 125
samura Avatar answered Sep 21 '22 15:09

samura