Dmitri Snytkine wrote:
While web isn't typed, the php is not just for the web anymore, or is it?
Some databases expect typed input, else the data is not found.
For example passing string '1' instead of number 1 will not cause any errors
when searching MongoDB but you will not get the result you expect to get if
the value of key is integer 1

I think THIS is the ideal example on why we do not want to 'fix problems' in PHP just because something else does not work properly. If I pass a numeric value to a parameter in my database interface I do not worry about how that parameter was provided. I would treat the above example as a simply bug in MongoDB and is actually one of the reasons I have not bothered even looking at it as an alternative. If I am looking for an age do I want to limit people to 'years' ... 5 and a 1/2 is an acceptable age and may be generated automatically if I'm generating the data from a previously provided date of birth ... I prefer to provide errors myself when processing input like this, and that is always more appropriate IN the getter/setter that is handling the input.

--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to