Named Parameter Inheritance

no-email (Damien Seguy), Damien Seguy
Thu, 30 Jan 2025 00:00:00 +0000

PHP enforces the methods compatibility with their types, names, and various options, but not with the parameter names. This means the parameter name existence is enforced, but the name might change. It might change between the parent and the child, but also, between the class and the interface.
It is recommended to keep all these parameter's name identical, so as to keep consistence in the code, and simplify the usage of the method, with named parameters.