Named Parameter Inheritance

../_images/named_parameter_inheritance.png

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.

See Also

PHP Error Messages

PHP Features