mirror of
https://github.com/php/phd.git
synced 2026-03-23 22:52:05 +01:00
### Motivation
- Enhances type safety and static analysis.
- Makes code intent clearer.
- Prepares PhD for PHP 8.4 compatibility and future strictness.
### Scope
- Added types such as `int`, `string`, `bool`, or `array` to class constants.
- Example:
Before:
`public const FORMAT_HTML = 1;`
`public const NAME = 'PhD';`
After:
`public const int FORMAT_HTML = 1;`
`public const string NAME = 'PhD';`
### Impact
- ✅ No runtime behavior change.
- ✅ Fully backward compatible with PHP 8.3+.
- ⚙️ Code clarity and safety improvement only.
- Updated `composer.json` to indicate PHP 8.3 requirement
- Removed 8.1 and 8.2 CI pipelines
### References
- [PHP 8.3: Typed class constants RFC](https://wiki.php.net/rfc/typed_class_constants)
- [PHP manual: Class constants](https://www.php.net/manual/en/language.oop5.constants.php)
---------
Co-authored-by: lacatoire <louis-arnaud.catoire@external.drivalia.com>