Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision |
rfc:typechecking [2009/07/03 20:51] – moved content to typecheckingstrictandweak and added disambiguation lsmith | rfc:typechecking [2013/02/13 21:15] – Removed return type hinting entry to withdrawn willfitch |
---|
===== Request for Comments: Parameter type specification ===== | ===== Request for Comments: Parameter type specification ===== |
| |
| Various RFCs that have been proposed for parameter and return typing. |
| |
=== History === | === History === |
PHP is a [[http://php.net/types|dynamically typed language]], that does [[http://php.net/manual/en/language.types.type-juggling.php|automatic type juggling]] where ever possible. With PHP 5 a new feature called [[http://ch2.php.net/manual/en/language.oop5.typehinting.php|"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. | PHP is a [[http://php.net/types|dynamically typed language]], that does [[http://php.net/manual/en/language.types.type-juggling.php|automatic type juggling]] where ever possible. With PHP 5 a new feature called [[http://ch2.php.net/manual/en/language.oop5.typehinting.php|"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. |
| |
| * [[rfc:returntypehint|Return value type hint]] by Felipe |
* [[rfc:typehint|Return value and parameter type hint]] by Felipe | * [[rfc:typehint|Return value and parameter type hint]] by Felipe |
* [[rfc:typecheckingstrictandweak|Strict and weak parameter type checking]] by Lukas | * [[rfc:typecheckingstrictandweak|Strict and weak parameter type checking]] by Lukas and Zeev |
* [[rfc:typecheckingstrictonly|Optional Strict Type Checking for Scalars]] by Paul | * [[rfc:typecheckingstrictonly|Optional Strict Type Checking for Scalars]] by Paul (Ilia's proposal) |
| * [[rfc:typecheckingparseronly|Parser and Reflection-API only Type Hints]] by Derick (Implemented) |
| * [[rfc:parameter_type_casting_hints|Parameter Type Casting Hints]] by Anthony |
| |