MIR0712
PropertyTypeRedeclarationMismatch
A property type declaration in a child class is incompatible with the parent class declaration. A redeclared property keeps the parent’s type, and is typed only if the parent’s is: adding a type to an untyped parent property, or dropping the parent’s type, is a fatal error too.
Example
Section titled “Example”<?phpclass Parent { public string $name;}
class Child extends Parent { public int $name; // Error: incompatible type}How to fix
Section titled “How to fix”Ensure the child class property type is compatible with the parent:
<?phpclass Parent { public string $name;}
class Child extends Parent { // Keep the same type public string $name;}