Gradual Type Checking
Gradual type checking is the progressive introduction of types in a code base. When a code base is not fully typed, it is in a state of gradual typing. Types are introduced, which leads to various levels of validation and verifications, and a better stability.
Gradual Type Checking ends when the code is all typed: arguments, return types, properties, constants. There might be some ambiguous situations, such as with variables, yields and use.
<?php
// partially typed function
function trumpet(int $i, $b) {
// some code
}
?>
See Also
- Gradual Type Checking & Sorbet
- What is Gradual Typing
- PHP’s Gradual Typing Journey: From Wild West to Almost Respectable