Note: this mirrors changes tracked in PHPC-1709.
Summary
The following typing improvements have been made since PHP 7.0:
- Introduction of scalar type and return types for methods (PHP 7.0)
- Nullable types and void return type (PHP 7.1)
- object type for arguments and return values (PHP 7.2)
- Union types (PHP 8.0)
Motivation
There is a push in the PHP ecosystem to use stricter typing when writing PHP code. While this is not as important for PHP extensions such as PHPC, it provides users with a sense of security in that argument types and return types are not only specified in documentation, but also set in code. Introducing such types can cause BC breaks when method signatures change, so these changes should be done with care to prevent unnecessary breakage in user projects that rely on this code.
Cast of Characters
Engineering Lead:
Document Author:
POCers:
Product Owner:
Program Manager:
Stakeholders:
Documentation
[Scope Document|some.url]
[Technical Design Document|some.url]
- is related to
-
PHPLIB-952 Fully Typed PHP library
- Canceled
-
PHPC-1709 PHPC typing improvements
- Development Complete
- split from
-
PHPLIB-571 Typing improvements to driver APIs
- Development Complete