Cannot make static method %s::%s() non static in class %s

Description

Once a method has been defined, the static keyword, or its absence, must be preserved for the same method in the children classes.

Example

<?php

class X {
    function static foo() {}
}

class Y extends X {
    function foo() {}
}

?>

Literal Examples

  • Cannot make static method X::foo() non static in class Y

Solutions

  • Remove the static keyword to the method in the parent class.

  • Add the static keyword in all eponymous methods in the children class.

  • Rename some of the methods to avoid a static conflict.