Skip to content

MIR0715

StaticPropertyRedeclarationMismatch

A static property in a child class conflicts with the parent’s declaration, such as incompatible types or modifiers.

<?php
class Parent {
public static string $name;
}
class Child extends Parent {
public static int $name; // Error: incompatible type
}

Ensure the child class static property type is compatible with the parent:

<?php
class Parent {
public static string $name;
}
class Child extends Parent {
// Keep the same type
public static string $name;
}