Hello, i should point out that it is all unicorns and rainbows for building
inernal apis and libraries. But in PHP you work with the world out there.
And that means you process GET, POST, xml, json and bunch of other data,
witch comes to you as text. Even db requests usually retirn text even with
numeric data. It all works great and easy now because PHP handles the
conversion, just have to check if the data is correct. So what will happen
with strict typing if i define an int and external data gives me a numeric
string? Or some ass tries to send me an array. Code just breaks into fatal
error? You can build a safe code that handles that, but if you write jist a
bunch of pretty strait forward scripts and you don't need all that complex
code with a framework type handling, sanitizing and so on.

Sure, inernal apis would be strictier and so on, but hell even now i think
it will make so much pain to make sure to convert all the data and params -
every db row, get params, xml data, etc. Duck typing is what makes php a
great tool for web development. And type hinting should be weak, trying to
convert data if is a now brainer and fail on real mistakes, like now
honting that you expect an array and a string is passed. But expecting an
int and passing a string containing int number should go smooth

Reply via email to