Re: E_STUPID

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2008-10-22 at 20:04 +0100, Stut wrote:
> On 22 Oct 2008, at 19:37, ceo@xxxxxxxxx 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/
> 
I quite like the way that Javascript handles this sort of thing. If you
use an array in a string, it just spits out all the values in a
comma-delimited list, which is quite convenient sometimes.


Ash
www.ashleysheridan.co.uk


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux