RE: [PHP-DEV] Re: Proposal

From: Date: Mon, 30 Jul 2001 08:08:55 +0000
Subject: RE: [PHP-DEV] Re: Proposal
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-61500@lists.php.net to get a copy of this message
At 01:07 30/07/2001, Marc Boeren wrote:
Hi, force a prefix onto the variable name. I.e., import_globals("GPC", "form_"); I like this idea (the whole idea of import_globals is good, I think, but I'd rather call it accept_globals, but more on that later :), only this would make it difficult to actually differentiate between get, post and cookie, needing import_globals("G", "get_"); import_globals("P", "post_"); and import_globals("C", "cookie_"); if that was needed. I would like to see it implemented something like accept_globals("GPC", 'user', 'password', 'value_*', 'more'); where you can specify both complete names and wildcards, even though I'd like a better range-check for the wildcard, perhaps something like value_[0..12].
I think that this is a clear example of "the enemy of good is the even better" (I'm not sure how well this translates to English :). We need to keep this function simple, and that way, it clearly isn't. If you want three different scopes, use 3 calls. If you want register_globals-like behavior only prefixed, use import_globals("GPC", "form_"). KISS should be our guiding light here. Zeev

« previous php.dev (#61500) next »