Provided you don't use extract() and only reference the indexes that you need, any extra passed things shouldn't be a problem.

-Kevin-

Lamont Peterson wrote:
On Saturday 10 January 2009 09:25:35 pm Kevin Carter wrote:
function do_something_awesome($params = array()) {
     $default = array(
         'a' => 'a',
         'b' => 'b',
     );
     $params = array_merge($default, $params);

     ....

}

Nice ... but not equivalent to what I had suggested.

The (minor) security problem with this one is that any parameters can be passed; we've lost control of what can be injected into the function. Other than that, I like that array_merge () approach, it would certainly run faster this way. Thank you.

[snip]


------------------------------------------------------------------------


_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net


_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to