Welcome Guest, Not a member yet? Register   Sign In
nasty code - varaiable variables varaible paramaters
#4

[eluser]xwero[/eluser]
Where is the overhead?
Code:
function one($one,$two,$three)
{
   return $one.' '.$two.' '.$three;
}
// vs
function one($array)
{
   return $array[0].' '.$array[1].' '.$array[2];
}
The only overhead i can think of is doing following
Code:
function one($array)
{
    list($one,$two,$three) = $array;
    return $one.' '.$two.' '.$three;
}
So it's only one line to create meaningful variables.

There is no func_set_args or something similar i know of. If you are going to support n parameters i think you will have no other option?


Messages In This Thread
nasty code - varaiable variables varaible paramaters - by El Forum - 03-07-2008, 03:18 PM
nasty code - varaiable variables varaible paramaters - by El Forum - 03-07-2008, 03:33 PM
nasty code - varaiable variables varaible paramaters - by El Forum - 03-07-2008, 03:49 PM
nasty code - varaiable variables varaible paramaters - by El Forum - 03-07-2008, 04:17 PM
nasty code - varaiable variables varaible paramaters - by El Forum - 03-08-2008, 04:34 AM
nasty code - varaiable variables varaible paramaters - by El Forum - 03-08-2008, 06:01 AM
nasty code - varaiable variables varaible paramaters - by El Forum - 03-08-2008, 08:14 AM
nasty code - varaiable variables varaible paramaters - by El Forum - 03-10-2008, 03:20 AM
nasty code - varaiable variables varaible paramaters - by El Forum - 03-10-2008, 03:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB