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]
--
Lamont Peterson <[email protected]>
Founder [ http://blog.OpenBrainstem.net/peregrine/ ]
GPG Key fingerprint: 0E35 93C5 4249 49F0 EC7B 4DDD BE46 4732 6460 CCB5
___ ____ _ _
/ _ \ _ __ ___ _ __ | __ ) _ __ __ _(_)_ __ ___| |_ ___ _ __ ___
| | | | '_ \ / _ \ '_ \| _ \| '__/ _` | | '_ \/ __| __/ _ \ '_ ` _ \
| |_| | |_) | __/ | | | |_) | | | (_| | | | | \__ \ || __/ | | | | |
\___/| .__/ \___|_| |_|____/|_| \__,_|_|_| |_|___/\__\___|_| |_| |_|
|_| Intelligent Open Source Software Engineering
[ http://www.OpenBrainstem.net/ ]
_______________________________________________
UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net