On Tue, Jul 15, 2014 at 02:19:46PM +0200, Ferenc Kovacs wrote: > But php doesn't care, because one of it's distinguished features is that it > can coerce between scalar types.
Yes: and you will still be able to do that. No one will take that away, so continue to use that where it is appropriate. > If we introduce scalar type hints, people will use it, if they will use it, > people have to be aware that they can't pass numeric looking strings into > functions and expect them to work. All input from a form needs to be validated before use; failure to do that is, unfortunately, common and leads to issues. If this helps remind people to do so then it can only be good. The first listed here is ' Improper input validation': http://www.softwaretestinghelp.com/top-25-common-programming-bugs-every-tester-should-know/ > It will blow up with a fat E_RECOVERABLE_ERROR. > But this won't hold back the library authors from using it, which means > that the consumers of those libs has to start coding defensively, and make > sure that the variable holding the value 123 is an integer and not a float > or a string, because that will blow up something. They will have it blow up when it first runs, fix the bug (add a cast or something) and move on. I think that it is an insult to PHP coders to assume that they will not be able to cope. They will scratch their heads the first time that it happens to them, google/... & learn. The benefit of this is fewer issues in libraries. It may also help by catching user/coder errors earlier and so make their life easier. There is trade off bet -- Alain Williams Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer. +44 (0) 787 668 0256 http://www.phcomp.co.uk/ Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php #include <std_disclaimer.h> -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php