rfc:typechecking
This is an old revision of the document!
Request for Comments: Parameter type specification
History
PHP is a dynamically typed language, that does automatic type juggling where ever possible. With PHP 5 a new feature called "type hinting" was introduced for arrays and objects. However the name “hint” is a bit misnamed, since triggers an E_RECOVERABLE_ERROR. While a fatal error can be prevented with an error handler, its not really nicely doable, since this needs to happen in a global error handler, far away in terms of code from the original context. It also comes with quite an overhead.
- Return value type hint by Felipe
- Return value and parameter type hint by Felipe
- Optional Strict Type Checking for Scalars by Paul (Ilia's proposal)
- Parser and Reflection-API only Type Hints by Derick (Implemented)
rfc/typechecking.1302087566.txt.gz · Last modified: 2017/09/22 13:28 (external edit)