On 12/05/15 20:57, Rowan Collins wrote: > Type hints are not intended for validating data that is entering or leaving > PHP from or to other systems, they are only relevant when passing data from > one part of a PHP system to another. On any given install of PHP, two > libraries communicating with each other by function calls will agree on a > definition of "int", because they are in the same process, and that is all > that is needed for an "int" type hint to be meaningful.
I think that perhaps this is a key point that needs to be fully documented before PHP7 is released. That type hints are essentially NOT to be used for data validation may not be obvious to many who are planning to 'convert' to using them? However I still don't see how one one can handle data handed over internally without also providing a mechanism to ensure the right range of value is maintained through the system. If a library produces results that are out of range of the target channel then simply establishing that it's a valid number is of limited use. It IS the handling of data validation as a central service that is needed, and why would one not then use that for the internal data handling as well? -- 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 Rainbow Digital Media - http://rainbowdigitalmedia.co.uk -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php