limits to functions?
Moderator: General Moderators
- SmokyBarnable
- Forum Contributor
- Posts: 105
- Joined: Wed Nov 01, 2006 5:44 pm
limits to functions?
Is there a limit to how many variables can be passed to a function?
There probably is but it shouldn't be a problem
Code: Select all
<?php
function foo() {
$params = func_get_args();
echo count($params), "\n";
}
for($e=1; $e<6; $e+=1) {
$params = range(1, pow(10, $e));
call_user_func_array('foo', $params);
}
?>Call it lack of imagination but I can't think of a well-designed function that takes a hundred thousand parameters.10
100
1000
10000
100000
- SmokyBarnable
- Forum Contributor
- Posts: 105
- Joined: Wed Nov 01, 2006 5:44 pm
- SmokyBarnable
- Forum Contributor
- Posts: 105
- Joined: Wed Nov 01, 2006 5:44 pm
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
call_user_func_array() isn't called inside a function in volka's example.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
-
omidkamangar
- Forum Newbie
- Posts: 16
- Joined: Sun Jul 30, 2006 2:51 pm