OT - Bizarre PHP problem/bug

Tod Hansmann tod at todandlorna.com
Mon Nov 22 17:56:09 MST 2010


On 11/22/2010 5:42 PM, Michael Torrie wrote:
> Ahh, so broken by design. Probably well-intentioned, but still utterly
> broken.  Even old BASIC would throw an error if you tried to convert or
> cast a string to a number that didn't have any numbers in it.
>
Not "broken" just one of the many cases that duck typing has to handle 
some way or another, and however it handles it will not work in all 
cases.  You have the same cases in any loosely typed language.  Granted, 
in this particular case we think it should behave differently, but if it 
did, that would break different cases, or be slower, or whatever 
tradeoff they weren't willing to make.

Welcome to the world of language design, where everyone's an expert and 
nobody's opinion matters =cP

-Tod Hansmann


More information about the PLUG mailing list