php calling abstract static function from inside abstrac class

Solutions on MaxInterview for php calling abstract static function from inside abstrac class by the best coders in the world

showing results for - "php calling abstract static function from inside abstrac class"
Natalia
15 Jan 2017
1abstract class AbstractFoo{
2    public static function foo() {
3        throw new RuntimeException("Unimplemented");
4    }
5    public static function getFoo(){
6        return static::foo();
7    }
8}
9
10class ConcreteFoo extends AbstractFoo{
11    public static function foo(){
12        return "bar";
13    }
14}
15
16echo ConcreteFoo::getFoo();
17