PHP 8 makes function signatures super expressive:
- Nullable Types (
?string): Accepts either astringornull. - Union Types (
int|string): Accepts more than one specific type. - Named Arguments: Pass arguments by parameter name in any order, skipping optional defaults cleanly.
ADVERTISEMENT