Re: Before March 1st aka PHP 5.1 beta
| From: | Lukas Smith | Date: | Thu, 17 Feb 2005 22:37:16 +0000 |
| Subject: | Re: Before March 1st aka PHP 5.1 beta | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-15077@lists.php.net to get a copy of this message | ||
Andi Gutmans wrote:
At 03:26 PM 2/17/2005 -0500, Daniel Convissor wrote:input filtering is not supposed to set defaults. so I would very much recommend not mixing the two. regards, LukasOn Thu, Feb 17, 2005 at 12:21:45PM -0800, Andi Gutmans wrote:Yeah I realize it's different but my idea was that if you havesomethinglike: filter_get(POST, "foo", FILTER_NUMBER) the semantics of this or someotherfunction could be: if (isset($_POST["foo"]) && is_number(..... I think in most cases that would do and doesn't require to add/change opcodes and language constructs...Yeah, but... what if one wants to call it on a variable that's not part of the superglobals? Plus that construct doesn't provide a way to set the default value for the particular variable at hand.Well the API could allow the option to provide a default value if the data doesn't match the input. That's why I used the word "could" because the API for the input filtering hasn't been finalized.