Re: E_STUPID
| From: | Stut | Date: | Wed, 22 Oct 2008 19:04:01 +0000 |
| Subject: | Re: E_STUPID | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-282286@lists.php.net to get a copy of this message | ||
On 22 Oct 2008, at 19:37, ceo@l-i-e.com wrote:
I think we need a new error reporting constant E_STUPID. This should catch stupid things I do like trying to embed an array into a string such as: $foo = array('a', 'b', 'c'); $query = "select * from foo where foo in ('$foo')"; It's been one of those days...I've had a great day, but then I'm on leave this week ;) I don't think you're far wrong with this one. I really think trying to use an array as a string should raise a warning. It's easily done and having it spit out "Array" is less than helpful. I think the same should be true of resources except that you should be able to force a resource to a string with an explicit cast. Loose typing is great but there are some conversions that never really make sense. -Stut -- http://stut.net/